from pyrogram import Client, idle
from pyrogram.handlers import MessageHandler
my_apps = [
Client("session1", app, "hash"),
Client("session2", app, "hash"),
Client("session3", app, "hash"),
]
async def test(client, message):
print(message)
for app in my_apps:
app.add_handler(MessageHandler(test))
app.start()
idle()
for app in my_apps:
app.stop()