Skip to content

Commit

Permalink
修复上次引入的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongfly authored Apr 19, 2018
1 parent b09daa9 commit 9f0ca34
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions telegram-asf.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def cmdtype(bot, update, job_queue, chat_data):
reply_markup = bots_menu(header=False)
else:
reply_markup = bots_menu()
chat_data['botname_markup'] = reply_markup
if isinstance(reply_markup, str):
chat_data['bot'] = reply_markup
return deal_command(bot, chat_id, job_queue, chat_data)
Expand Down Expand Up @@ -206,16 +207,22 @@ def back2botname(bot, update, job_queue, chat_data):
deljob(chat_data)
query = update.callback_query
chat_id = query.message.chat_id
if chat_data['type'] == 'redeem':
reply_markup = bots_menu(header=False)
reply_markup = chat_data['botname_markup']
if isinstance(reply_markup, str):
bot.editMessageText(text='请选择命令\n发送 /cancel 退出',
chat_id=chat_id, message_id=chat_data['msg'], reply_markup=cmd_menu)
job = job_queue.run_once(
timeout, 120, context=(chat_id, chat_data['msg']))
chat_data['job'] = job
return TYPE
else:
reply_markup = bots_menu()
bot.editMessageText(
chat_id=chat_id, message_id=chat_data['msg'], text='请选择BOT\n发送 /cancel 退出', reply_markup=reply_markup)
# bot.editMessageReplyMarkup(chat_id=chat_id, message_id=chat_data['msg'], reply_markup=reply_markup)
job = job_queue.run_once(timeout, 120, context=(chat_id, chat_data['msg']))
chat_data['job'] = job
return BOTNAME
bot.editMessageText(
chat_id=chat_id, message_id=chat_data['msg'], text='请选择BOT\n发送 /cancel 退出', reply_markup=reply_markup)
# bot.editMessageReplyMarkup(chat_id=chat_id, message_id=chat_data['msg'], reply_markup=reply_markup)
job = job_queue.run_once(
timeout, 120, context=(chat_id, chat_data['msg']))
chat_data['job'] = job
return BOTNAME


def others(bot, update, chat_data):
Expand Down

0 comments on commit 9f0ca34

Please sign in to comment.