Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from userbot import bot
- from telethon import functions, types
- from userbot.events import register
- isAFK = False
- Approved = []
- @register(outgoing=True, pattern="^[.]afk$")
- async def setAFK(e):
- global isAFK
- if isAFK:
- isAFK = False
- await e.edit("**❌ AFK Mode Disattivata! ❌**")
- else:
- isAFK = True
- await e.edit("**✅ AFK Mode Attivata! ✅**")
- @register(outgoing=True, pattern="^[.]approve$")
- async def Approve(e):
- global Approved
- if e.is_private and not (await e.get_sender()).bot:
- if e.chat_id in Approved:
- await e.edit("**❌ Quest utente é già approvato ❌**")
- else:
- Approved.append(e.chat_id)
- await e.edit("**✅ Utente Approvato ✅**")
- @register(outgoing=True, pattern="^[.]disapprove$")
- async def Disapprove(e):
- global Approved
- if e.is_private and not (await e.get_sender()).bot:
- if e.chat_id in Approved:
- Approved.remove(e.chat_id)
- await e.edit("**🚫 Utente Disapprovato 🚫**")
- else:
- await e.edit("**❌ Quest utente non é approvato ❌**")
- @register(incoming=True)
- async def AFK(e):
- global isAFK, Approved
- if isAFK:
- if e.is_private and not (await e.get_sender()).bot:
- if not e.chat_id in Approved:
- await e.delete()
- await e.respond("RISPOSTA AUTOMATICA QUI")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement