【发布时间】:2019-11-22 05:27:33
【问题描述】:
所以我正在用 pyTelegramBotApi 制作一个电报机器人 我做了一个回复键盘,它出现在 /start 命令之后,问题是当用户按下按钮时,他们应该收到一些消息和一个内联键盘。而且我不知道如何将内联键盘(有点)放在回复键盘中。
def start_command(message):
keyboard = types.ReplyKeyboardMarkup(row_width=1, resize_keyboard=True)
button1 = types.KeyboardButton(text="Button 1", FUNC1)
button2 = types.KeyboardButton(text="Button 2", FUNC2)
button3 = types.KeyboardButton(text="Button 3", FUNC3)
keyboard.add(button1, button2, button3)
bot.send_message(
message.chat.id,
'Hello!',
reply_markup=keyboard
)
FUNC1、FUNC2、FUNC3 表示应该使用内联键盘发送文本的事物(函数)
【问题讨论】:
标签: python telegram telegram-bot