From 76b75ab5c608d6689dd67baa70fcb32a000dc341 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Mon, 17 Jun 2019 20:17:32 +0600 Subject: [PATCH] =?UTF-8?q?Updated=20Extensions=20=E2=80=93=20Your=20first?= =?UTF-8?q?=20Bot=20(markdown)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Extensions-–-Your-first-Bot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Extensions-–-Your-first-Bot.md b/Extensions-–-Your-first-Bot.md index 2a60c6e..1002181 100644 --- a/Extensions-–-Your-first-Bot.md +++ b/Extensions-–-Your-first-Bot.md @@ -76,7 +76,7 @@ But our Bot can now only answer to the `/start` command. Let's add another handl ```python def echo(update, context): - context.bot.send_message(chat_id=update.message.chat_id, text=update.message.text) + update.send_message(chat_id=context.message.chat_id, text=context.message.text) from telegram.ext import MessageHandler, Filters echo_handler = MessageHandler(Filters.text, echo) @@ -95,7 +95,7 @@ Let's add some actual functionality to your bot. We want to implement a `/caps` ```python def caps(update, context): text_caps = ' '.join(context.args).upper() - context.bot.send_message(chat_id=update.message.chat_id, text=text_caps) + update.send_message(chat_id=context.message.chat_id, text=text_caps) caps_handler = CommandHandler('caps', caps) dispatcher.add_handler(caps_handler)