telegram bot webhook 接受text示例代码

145次阅读
没有评论

共计 276 个字符,预计需要花费 1 分钟才能阅读完成。

$bot->on
(
    function($Update) use ($bot) {
        $message = $Update->getMessage();
        $input = $message->getText();
        
        $cid = $message->getChat()->getId();
        
  $int_rand = rand(0, 9);
        $bot->sendMessage($cid, "test new" . $int_rand . $input, null, TRUE, null, null);
    },
        function($message) use ($bot) {
            return true;
        } );
        $bot->run();

 

正文完
 
admin
版权声明:本站原创文章,由 admin 2020-05-01发表,共计276字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
验证码