31 March 2025
AmirHosseintext not yet in the index
import asyncio
from pyrogram import Client, filters, compose
apps = [
Client("account1"),
Client("account2"),
Client("account3")
]
async def handle():
for app in apps:
@app.on_message(filters.channel)
async def start(client, message):
await message.reply("سلام")
async def main():
await handle()
await compose(apps)
asyncio.run(main())
ʀᴍ > /ᴅᴇᴠ/ɴᴜʟʟimport asyncio
from pyrogram import Client, filters, compose
apps = [
Client("account1"),
Client("account2"),
Client("account3")
]
async def handle():
for app in apps:
@app.on_message(filters.channel)
async def start(client, message):
await message.reply
این چه گوهی بود
ی فولدر پلاگین بده بهش دیگه گوه بازیا چیه
Replymessage unavailable
ی فولدر بساز هندلرات بنداز توش
مثلا
plugins/start.py
from pyrogram import Client
@Client.on_message()
def start(_, m):
await m.reply("hi")
بعد برای هر کلاینتت
Client(name="name", plugins={"root": "plugins"}
و در اخر همشون رو استارت کن و ی idle بزن
Moonاین چه گوهی بود
ی فولدر پلاگین بده بهش دیگه گوه بازیا چیه
اینم میشه …
در فولدر اصلی داخل مثلا فایل main.py
import asyncio
from pyrogram import Client, compose
apps = [
Client("account1", plugins=dict(root="plugins")),
Client("account2", plugins=dict(root="plugins")),
Client("account3", plugins=dict(root="plugins"))
]
async def main():
await compose(apps)
asyncio.run(main())
و در فولدر :
plugins/start.py
from pyrogram import Client, filters
@Client.on_message(filters.channel)
async def start(client, message):
await message.reply("سلام")