From bd121be76d5d7d0fceecb26c7aa6ed32ee44f71c Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 9 Oct 2018 13:50:34 +0200 Subject: [PATCH] Update echo_bot.py --- examples/echo_bot.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/echo_bot.py b/examples/echo_bot.py index adda52c7..70e26f9d 100644 --- a/examples/echo_bot.py +++ b/examples/echo_bot.py @@ -20,9 +20,8 @@ from pyrogram import Client, Filters """This simple echo bot replies to every private text message. -It uses the @on_message decorator to register a MessageHandler -and applies two filters on it, Filters.text and Filters.private to make -sure it will only reply to private text messages. +It uses the @on_message decorator to register a MessageHandler and applies two filters on it: +Filters.text and Filters.private to make sure it will reply to private text messages only. """ app = Client("my_account") @@ -30,10 +29,7 @@ app = Client("my_account") @app.on_message(Filters.text & Filters.private) def echo(client, message): - client.send_message( - message.chat.id, message.text, - reply_to_message_id=message.message_id - ) + message.reply(message.text, quote=True) app.run() # Automatically start() and idle()