add cancel button in private messages
This commit is contained in:
parent
186bb6f682
commit
fb0cfc2632
|
@ -520,7 +520,12 @@ How can I help you?"""
|
|||
|
||||
options['Roll dices (shortcut: /roll <dice>)'] = 'roll'
|
||||
options['Roll dices secretly (shortcut: /gmroll)'] = 'gmroll'
|
||||
options['Go to official site ->'] = {'url': 'https://github.com/simonebaracchi/rpgbot'}
|
||||
|
||||
subopts = OrderedDict()
|
||||
subopts['Go to official site ->'] = {'url': 'https://github.com/simonebaracchi/rpgbot'}
|
||||
subopts['Cancel'] = 'cancel'
|
||||
options['dummy3'] = subopts
|
||||
|
||||
handler.send('How can I help you?', options=options, allowedit=True)
|
||||
else:
|
||||
# Game is started in the group!
|
||||
|
|
|
@ -106,7 +106,10 @@ class MessageHandler(telepot.helper.ChatHandler):
|
|||
else:
|
||||
sublist = []
|
||||
for key, subvalue in value.items():
|
||||
sublist.append(InlineKeyboardButton(text=key, callback_data=subvalue))
|
||||
if isinstance(subvalue, dict) and 'url' in subvalue:
|
||||
sublist.append(InlineKeyboardButton(text=key, url=subvalue['url']))
|
||||
else:
|
||||
sublist.append(InlineKeyboardButton(text=key, callback_data=subvalue))
|
||||
buttons.append(sublist)
|
||||
else:
|
||||
buttons.append([InlineKeyboardButton(text=key, callback_data=value)])
|
||||
|
|
Loading…
Reference in New Issue