mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-31 06:16:06 +00:00
Update examples
This commit is contained in:
17
examples/echo_bot.py
Normal file
17
examples/echo_bot.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from pyrogram import Client, Filters
|
||||
|
||||
"""This simple echo bot replies to every private text message"""
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
|
||||
app.start()
|
||||
app.idle()
|
Reference in New Issue
Block a user