mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-24 19:07:57 +00:00
Update echo_bot.py
This commit is contained in:
parent
3fa738db9f
commit
bd121be76d
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user