从电报Bot sdk https://telegram-bot-sdk.readme.io/v2.0/docs/keyboards中获取此错误,我想使用ReplyKeyboardMarkup方法获取此错误
production.ERROR: Method [ReplyKeyboardMarkup] does not exist. {"exception":"[object] (BadMethodCallException(code: 0): Method [ReplyKeyboardMarkup] does not exist. at /app/vendor/irazasyed/telegram-bot-sdk/src/Api.php:98)
现在我知道这应该是一种类型,而不是一种方法,但是解决方法是有人可以提供帮助的问题。
这就是我所做的
$reply_markup = \Telegram::replyKeyboardMarkup([
'keyboard' => $keyboard,
'resize_keyboard' => true,
'one_time_keyboard' => true
]);
$response = \Telegram::sendMessage([
'chat_id' => 'CHAT_ID',
'text' => 'Hello World',
'reply_markup' => $reply_markup
]);
答案 0 :(得分:0)
实际上不建议使用replyKeyboardMarkup
,因此现在使用的是use use Telegram\Bot\Keyboard\Keyboard;
,然后
Keyboard::make([
'keyboard' => $keyboard,
'resize_keyboard' => true,
'one_time_keyboard' => true
]);