Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.32 KB | None | 0 0
  1. from userbot import bot
  2.  
  3. from telethon import functions, types
  4.  
  5. from userbot.events import register
  6.  
  7. isAFK = False
  8. Approved = []
  9.  
  10. @register(outgoing=True, pattern="^[.]afk$")
  11. async def setAFK(e):
  12.   global isAFK
  13.   if isAFK:
  14.     isAFK = False
  15.     await e.edit("**❌ AFK Mode Disattivata! ❌**")
  16.   else:
  17.     isAFK = True
  18.     await e.edit("**✅ AFK Mode Attivata! ✅**")
  19.  
  20. @register(outgoing=True, pattern="^[.]approve$")
  21. async def Approve(e):
  22.   global Approved
  23.   if e.is_private and not (await e.get_sender()).bot:
  24.     if e.chat_id in Approved:
  25.       await e.edit("**❌ Quest utente é già approvato ❌**")
  26.     else:
  27.       Approved.append(e.chat_id)
  28.       await e.edit("**✅ Utente Approvato ✅**")
  29.  
  30. @register(outgoing=True, pattern="^[.]disapprove$")
  31. async def Disapprove(e):
  32.   global Approved
  33.   if e.is_private and not (await e.get_sender()).bot:
  34.     if e.chat_id in Approved:
  35.       Approved.remove(e.chat_id)
  36.       await e.edit("**🚫 Utente Disapprovato 🚫**")
  37.     else:
  38.       await e.edit("**❌ Quest utente non é approvato ❌**")
  39.  
  40. @register(incoming=True)
  41. async def AFK(e):
  42.   global isAFK, Approved
  43.   if isAFK:
  44.     if e.is_private and not (await e.get_sender()).bot:
  45.       if not e.chat_id in Approved:
  46.         await e.delete()
  47.         await e.respond("RISPOSTA AUTOMATICA QUI")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement