laravel Laraavel Botman获取消息ID

6jygbczu  于 2023-08-08  发布在  其他
关注(0)|答案(1)|浏览(95)
  • BotMan版本:2.6.1
  • PHP版本:7.3| 8.0
  • 消息服务:网页
  • 缓存驱动程序: laravel

说明:

我试图删除最后一条机器人消息。我怎么能这样做?

复制步骤:

1.我使用了ask方法来获取答案id
$this->ask('问我什么?' function($answer){ $this->say(json_encode($this->bot->getMessage()->getPayload();
})并得到了这个结果:

{"driver":"web","userId":"mceiov","message":"ru","attachment":"null","interactive":"1"}

字符串
1.要发送删除请求,我需要消息ID
$apiParameters = [ 'chat_id' =>'','message_id' => '' ];$this->bot->sendRequest('deleteMessage',$apiParameters);
谢谢你,谢谢

x3naxklr

x3naxklr1#

使用这个:

$question = 'Ask me something?';
$next = function($answer){
    $this->say(json_encode($this->bot->getMessage()->getPayload()));
};

$this->bot->reply($question, []);
$this->bot->storeConversation($this, $next, $question, []);

字符串

相关问题