Telethon-Music / Zaid /status.py
xteamki's picture
Upload 4 files
1b9a7d4 verified
raw
history blame contribute delete
530 Bytes
import functools
def is_admin(func):
@functools.wraps(func)
async def a_c(event):
is_admin = False
if not event.is_private:
try:
_s = await event.client.get_permissions(event.chat_id, event.sender_id)
if _s.is_admin:
is_admin = True
except:
is_admin = False
if is_admin:
await func(event, _s)
else:
await event.reply("Only Admins can execute this command!")
return a_c