all: handle replies

ninja_fix
Dan Elkouby 2018-06-24 15:49:45 +03:00
parent 961d6c1445
commit 773190dd1e
1 changed files with 5 additions and 2 deletions

View File

@ -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)