Add all plugin

This commit is contained in:
Dan Elkouby 2018-05-18 16:45:09 +00:00
parent b23be7d013
commit 4d0198b060
1 changed files with 13 additions and 0 deletions

13
stdplugins/all.py Normal file
View File

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