From 4d0198b0604ec65b13a69f0ab5bd0bb19adbf65f Mon Sep 17 00:00:00 2001 From: Dan Elkouby Date: Fri, 18 May 2018 16:45:09 +0000 Subject: [PATCH] Add all plugin --- stdplugins/all.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 stdplugins/all.py diff --git a/stdplugins/all.py b/stdplugins/all.py new file mode 100644 index 0000000..fbf6775 --- /dev/null +++ b/stdplugins/all.py @@ -0,0 +1,13 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from telethon import events + +@borg.on(events.NewMessage(pattern=r".all", outgoing=True)) +async def _(event): + await event.delete() + mentions = "@all" + async for x in borg.iter_participants(await event.input_chat, 100): + mentions += f"[\u2063](tg://user?id={x.id})" + await event.respond(mentions)