【发布时间】:2021-01-12 03:00:18
【问题描述】:
我对 Telegram SDK 有一些问题!如下图所示,我要求在用户输入 /addnotification 命令后输入一些标题,这里用户应该输入一些通知标题,但我无法得到它,因为更新给了我最后一条消息,即命令 /addnotification!如果有人知道答案,请帮忙!
public function handle()
{
$telegram = new Api(Telegram::getAccessToken());
$update = Telegram::getWebhookUpdates();
$chat_id = $update->getMessage()->getChat()->getId();
$text= $update->getMessage()->getText();
$response = $telegram->sendMessage([
'chat_id' => $chat_id,
'text' => 'Пожалуйста введите событие или дело который вы хотели бы добавить.'
]);
// $messageId = $response->getMessageId();
$this->replyWithMessage(['text' => 'Поздравляем! Вы успешно добавили событие!!!']);
$this->replyWithMessage(['text' => 'Название - ' . $text]);
$this->replyWithMessage(['text' => 'Chat Id - ' . $chat_id]);
// $this->replyWithMessage(['text' => $messageId]);
}
}
在这里输入命令后用户应该输入一些标题,我想得到这个标题(消息),但是更新给出的消息是命令!
【问题讨论】: