我可以使用 Telepot 将内联键盘按钮放在多行上吗?
如果我能做到,我该怎么做?
我试过这个例子来学习如何使用 InlineKeyboard,
但我没有在 Telepot 中找到其他关于内联键盘的文档(官方文档除外)
import sys
import time
import telepot
from telepot.namedtuple import ReplyKeyboardMarkup, KeyboardButton
def on_chat_message(msg):
content_type, chat_type, chat_id = telepot.glance(msg)
print('Chat Message:', content_type, chat_type, chat_id)
if content_type == 'text':
if msg['text'] == '/key':
bot.sendMessage(chat_id, 'testing custom keyboard',
reply_markup=ReplyKeyboardMarkup(
keyboard=[
[KeyboardButton(text="btn1"), KeyboardButton(text="btn2"),KeyboardButton(text="btn3"), KeyboardButton(text="btn4")]
]
))
TOKEN = sys.argv[1] # get token from command-line
bot = telepot.Bot(TOKEN)
print('Listening ...')
bot.message_loop({'chat': on_chat_message}, run_forever=True)
请我需要帮助
谢谢