当我发送新的内联键盘时,我需要从以前的聊天中删除重播标记键盘,我的代码与此相同:
if msg.message.contact then
local keyboard = {}
keyboard.inline_keyboard = {
{ {text = 'yes',callback_data = 'yes_contact'},{text = 'no',callback_data = 'no_contact'}}
}
sendmsg(msg.message.from.id,string.format("*your send number * n` %s `n confirm", msg.message.contact.phone_number),keyboard)
end
我尝试使用keyboard.remove_keyboard = true
所以我将代码更改为
local keyboard = {}
keyboard.remove_keyboard = true,
keyboard.inline_keyboard = {
{ {text = 'yes',callback_data = 'yes_contact'},{text = 'no',callback_data = 'no_contact'}}
}
但是Lua给我错误,这是什么问题?
根据sendMessage中的reply_markup
类型,似乎它只能包含InlineKeyboardMarkup
或ReplyKeyboardRemove
:(
有一个解决方法,您可以发送带有ReplyKeyboardRemove
的消息,并使用editMessageReplyMarkup添加内联键盘。