mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-16 20:29:55 +01:00
remove cancel command
This commit is contained in:
parent
53d1d5f589
commit
1544f612ae
1 changed files with 1 additions and 11 deletions
|
@ -43,8 +43,7 @@ def set_value(bot, update):
|
|||
if user_state == MENU:
|
||||
state[user_id] = AWAIT_INPUT # set the state
|
||||
bot.sendMessage(chat_id,
|
||||
text="Please enter your settings value or send "
|
||||
"/cancel to abort",
|
||||
text="Please enter your settings value",
|
||||
reply_markup=ForceReply())
|
||||
|
||||
|
||||
|
@ -93,14 +92,6 @@ def confirm_value(bot, update):
|
|||
query.message.message_id)
|
||||
|
||||
|
||||
# Handler for the /cancel command.
|
||||
# Sets the state back to MENU and clears the context
|
||||
def cancel(bot, update):
|
||||
user_id = update.message.from_user.id
|
||||
del state[user_id]
|
||||
del context[user_id]
|
||||
|
||||
|
||||
def help(bot, update):
|
||||
bot.sendMessage(update.message.chat_id, text="Use /set to test this bot.")
|
||||
|
||||
|
@ -117,7 +108,6 @@ updater.dispatcher.addHandler(CommandHandler('set', set_value))
|
|||
updater.dispatcher.addHandler(MessageHandler([filters.TEXT], entered_value))
|
||||
# The confirmation
|
||||
updater.dispatcher.addHandler(CallbackQueryHandler(confirm_value))
|
||||
updater.dispatcher.addHandler(CommandHandler('cancel', cancel))
|
||||
updater.dispatcher.addHandler(CommandHandler('start', help))
|
||||
updater.dispatcher.addHandler(CommandHandler('help', help))
|
||||
updater.dispatcher.addErrorHandler(error)
|
||||
|
|
Loading…
Add table
Reference in a new issue