From 773190dd1e6df014591ed0b5fc738850506b6e2b Mon Sep 17 00:00:00 2001 From: Dan Elkouby Date: Sun, 24 Jun 2018 15:49:45 +0300 Subject: [PATCH] all: handle replies --- stdplugins/all.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stdplugins/all.py b/stdplugins/all.py index 2379ffd..e263750 100644 --- a/stdplugins/all.py +++ b/stdplugins/all.py @@ -4,12 +4,15 @@ from telethon import events + @borg.on(events.NewMessage(pattern=r"\.all", outgoing=True)) async def _(event): if event.fwd_from: return await event.delete() mentions = "@all" - async for x in borg.iter_participants(await event.get_input_chat(), 100): + chat = await event.get_input_chat() + async for x in borg.iter_participants(chat, 100): mentions += f"[\u2063](tg://user?id={x.id})" - await event.respond(mentions) + await borg.send_message( + chat, mentions, reply_to=event.message.reply_to_msg_id)