Skip to content

Commit 2339606

Browse files
committed
Added erroneous parameter definition callback
1 parent 9403113 commit 2339606

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

examples/autowiring.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ def regex_with_groups(bot, update, groups, groupdict):
6464
update.message.reply_text('Groupdict: {}'.format(groupdict))
6565

6666

67+
def callback_undefined_arguments(bot, update, chat_data, groups):
68+
pass
69+
70+
6771
def main():
6872
# Create the Updater and pass it your bot's token.
69-
updater = Updater("TOKEN")
73+
updater = Updater("324133401:AAHVjjXotCDXC_kIIkfM0O6bm9-l7BfJw-I")
7074

7175
# Get the dispatcher to register handlers
7276
dp = updater.dispatcher
@@ -92,6 +96,10 @@ def main():
9296
# ... is equivalent to passing them automagically.
9397
dp.add_handler(CommandHandler("data", callback_with_data, autowire=True))
9498

99+
# An example of using the `groups` parameter which is not defined for a CommandHandler.
100+
# Uncomment the line below and you will see a warning.
101+
# dp.add_handler(CommandHandler("erroneous", callback_undefined_arguments, autowire=True))
102+
95103
dp.add_error_handler(error)
96104
updater.start_polling()
97105

0 commit comments

Comments
 (0)