Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import asyncio
- from userbot import bot
- from telethon import functions, types
- from userbot.events import register
- isAFK = False
- inWait = []
- 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()
- if not e.chat_id in inWait:
- await e.respond(f"⛔️ In questo momento sono offline!\n\n⚠️ Sei pregato di non inviare 400 messaggi perché tanto ho le notifiche silenziate!\n\n😘 Appena possibile ti risponderò,grazie per l'attesa!\n\n🔥Il tuo messaggio è stato salvato qui —> {e.text} \n\n- - - - - - - - - - - - - - - - - - - - -\n\n⛔️ I'm offline right now!\n\n⚠️ Please do not send 400 messages, I have silenced notifications!\n\n😘 I will answer you as soon as possible, thanks for waiting!\n\n🔥Il tuo messaggio è stato salvato qui—> {e.text}")
- inWait.append(e.chat_id)
- await asyncio.sleep(30)
- inWait.remove(e.chat_id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement