business_echo_bot#
This simple echo bot replies to every private business message.
It uses the on_message()
decorator to register a MessageHandler
and applies two filters on it:
filters.tg_business
and filters.private
to make sure it will reply to private business messages only.
from pyrogram import Client, filters
app = Client("my_account")
@app.on_message(filters.tg_business & filters.private)
async def echo(client, message):
await message.copy(message.chat.id)
app.run() # Automatically start() and idle()
You can explore more advanced usages by directly working with the raw Telegram API.