From b1fa41eb2fc5ece8c1ed3a2117adf48900c4c492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joscha=20G=C3=B6tzer?= Date: Wed, 27 Dec 2017 22:56:59 +0100 Subject: [PATCH] Updated Types of Handlers (markdown) --- Types-of-Handlers.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Types-of-Handlers.md b/Types-of-Handlers.md index ba556d6..b9cfc10 100644 --- a/Types-of-Handlers.md +++ b/Types-of-Handlers.md @@ -1,8 +1,9 @@ A `Handler` is an instance derived from the base class [telegram.ext.Handler](https://python-telegram-bot.readthedocs.io/en/latest/telegram.ext.handler.html#telegram.ext.Handler) which is responsible for the routing of different kinds of updates (text, audio, inlinequery, button presses, ...) to their _corresponding callback function_ in your code. -For example, if you want your bot to respond to the command `/start`, you can use a [CommandHandler](https://python-telegram-bot.readthedocs.io/en/latest/telegram.ext.commandhandler.html) that maps the input to a callback: +For example, if you want your bot to respond to the command `/start`, you can use a [CommandHandler](https://python-telegram-bot.readthedocs.io/en/latest/telegram.ext.commandhandler.html) that maps the input to a callback named `my_start_callback`: ``` def my_start_callback(bot, update): update.message.reply_text("Welcome to my awesome bot!") ... -dispatcher.add_handler(CommandHandler("start", my_callback))``` \ No newline at end of file + +dispatcher.add_handler(CommandHandler("start", my_start_callback))``` \ No newline at end of file