mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-22 15:17:00 +01:00
Don't override builtin method help() in examples (#1997)
* Do not override builtin method help() * Rename inlinebot and inlinekeyboard /help function to not conflict with builtin
This commit is contained in:
parent
6005861f46
commit
0af5cc2db8
3 changed files with 6 additions and 6 deletions
|
@ -33,7 +33,7 @@ def start(update, context):
|
||||||
update.message.reply_text('Hi!')
|
update.message.reply_text('Hi!')
|
||||||
|
|
||||||
|
|
||||||
def help(update, context):
|
def help_command(update, context):
|
||||||
"""Send a message when the command /help is issued."""
|
"""Send a message when the command /help is issued."""
|
||||||
update.message.reply_text('Help!')
|
update.message.reply_text('Help!')
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ def main():
|
||||||
|
|
||||||
# on different commands - answer in Telegram
|
# on different commands - answer in Telegram
|
||||||
dp.add_handler(CommandHandler("start", start))
|
dp.add_handler(CommandHandler("start", start))
|
||||||
dp.add_handler(CommandHandler("help", help))
|
dp.add_handler(CommandHandler("help", help_command))
|
||||||
|
|
||||||
# on noncommand i.e message - echo the message on Telegram
|
# on noncommand i.e message - echo the message on Telegram
|
||||||
dp.add_handler(MessageHandler(Filters.text, echo))
|
dp.add_handler(MessageHandler(Filters.text, echo))
|
||||||
|
|
|
@ -34,7 +34,7 @@ def start(update, context):
|
||||||
update.message.reply_text('Hi!')
|
update.message.reply_text('Hi!')
|
||||||
|
|
||||||
|
|
||||||
def help(update, context):
|
def help_command(update, context):
|
||||||
"""Send a message when the command /help is issued."""
|
"""Send a message when the command /help is issued."""
|
||||||
update.message.reply_text('Help!')
|
update.message.reply_text('Help!')
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ def main():
|
||||||
|
|
||||||
# on different commands - answer in Telegram
|
# on different commands - answer in Telegram
|
||||||
dp.add_handler(CommandHandler("start", start))
|
dp.add_handler(CommandHandler("start", start))
|
||||||
dp.add_handler(CommandHandler("help", help))
|
dp.add_handler(CommandHandler("help", help_command))
|
||||||
|
|
||||||
# on noncommand i.e message - echo the message on Telegram
|
# on noncommand i.e message - echo the message on Telegram
|
||||||
dp.add_handler(InlineQueryHandler(inlinequery))
|
dp.add_handler(InlineQueryHandler(inlinequery))
|
||||||
|
|
|
@ -36,7 +36,7 @@ def button(update, context):
|
||||||
query.edit_message_text(text="Selected option: {}".format(query.data))
|
query.edit_message_text(text="Selected option: {}".format(query.data))
|
||||||
|
|
||||||
|
|
||||||
def help(update, context):
|
def help_command(update, context):
|
||||||
update.message.reply_text("Use /start to test this bot.")
|
update.message.reply_text("Use /start to test this bot.")
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ def main():
|
||||||
|
|
||||||
updater.dispatcher.add_handler(CommandHandler('start', start))
|
updater.dispatcher.add_handler(CommandHandler('start', start))
|
||||||
updater.dispatcher.add_handler(CallbackQueryHandler(button))
|
updater.dispatcher.add_handler(CallbackQueryHandler(button))
|
||||||
updater.dispatcher.add_handler(CommandHandler('help', help))
|
updater.dispatcher.add_handler(CommandHandler('help', help_command))
|
||||||
|
|
||||||
# Start the Bot
|
# Start the Bot
|
||||||
updater.start_polling()
|
updater.start_polling()
|
||||||
|
|
Loading…
Reference in a new issue