mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-01-03 09:49:21 +01:00
Rename error_handler.py to errorhandlerbot.py and add a start command
This commit is contained in:
parent
37230843dd
commit
fdf8124965
1 changed files with 6 additions and 1 deletions
|
@ -56,6 +56,10 @@ def bad_command(update: Update, context: CallbackContext):
|
|||
context.bot.wrong_method_name()
|
||||
|
||||
|
||||
def start(update: Update, context: CallbackContext):
|
||||
update.effective_message.reply_text('Use /bad_command to cause an error.')
|
||||
|
||||
|
||||
def main():
|
||||
# Create the Updater and pass it your bot's token.
|
||||
# Make sure to set use_context=True to use the new context based callbacks
|
||||
|
@ -65,7 +69,8 @@ def main():
|
|||
# Get the dispatcher to register handlers
|
||||
dp = updater.dispatcher
|
||||
|
||||
# Register the command...
|
||||
# Register the commands...
|
||||
dp.add_handler(CommandHandler('start', start))
|
||||
dp.add_handler(CommandHandler('bad_command', bad_command))
|
||||
|
||||
# ...and the error handler
|
Loading…
Reference in a new issue