business_echo_bot

This simple echo bot replies to every private business message.

It uses the on_business_message() decorator to register a BusinessMessageHandler. Business messages have their own handler: they never reach on_message(), so a bot can serve its own chats and a connected account’s chats without the two streams mixing.

Usable by Users Bots
from pyrogram import Client, filters

app = Client("my_account")


@app.on_business_message(filters.private)
async def echo(client, message):
    await message.copy(message.chat.id)


app.run()  # Automatically start() and idle()

See Business Accounts for connections, permissions and account management.