【发布时间】:2017-06-13 14:49:06
【问题描述】:
有没有办法自定义键盘上的按钮位置?
例子:我们有
import telegram
def start(bot, update):
kb = [[telegram.KeyboardButton('/command1')],
[telegram.KeyboardButton('/command2')],
[telegram.KeyboardButton('/command3')]]
kb_markup = telegram.ReplyKeyboardMarkup(kb, resize_keyboard=True)
bot.send_message(chat_id=update.message.chat_id,
text="Welcome!",
reply_markup=kb_markup)
因此我们的键盘有 3 个按钮,每个按钮在自己的一行中。
我想在第一行有 2 个按钮,在第二行有 1 个按钮。有可能吗?
【问题讨论】:
标签: python telegram telegram-bot python-telegram-bot