forked from kate/uniborg
all: handle replies
This commit is contained in:
parent
961d6c1445
commit
773190dd1e
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue