Skip to content
This repository has been archived by the owner on Jul 10, 2022. It is now read-only.

Commit

Permalink
@admin tag will now work without @MaterTagAlertBot
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe committed Mar 26, 2019
1 parent 2fcf126 commit 3645321
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions stdplugins/call_admin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
"""/admin Plugin for @UniBorg"""
from telethon import events
""".admin Plugin for @UniBorg"""
import asyncio
from telethon import events
from telethon.tl.types import ChannelParticipantsAdmins


@borg.on(events.NewMessage(pattern=r"\/admin", outgoing=True))
@borg.on(events.NewMessage(pattern=r"\@admin", outgoing=True))
async def _(event):
if event.fwd_from:
return
await event.edit("@admin")
await asyncio.sleep(5)
await event.delete()
mentions = "admin"
chat = await event.get_input_chat()
async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins):
mentions += f"[\u2063](tg://user?id={x.id})"
await event.edit(mentions)

0 comments on commit 3645321

Please sign in to comment.