Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.38 KB | None | 0 0
  1. #ON & OFF
  2. ON = "π΄π‘Ÿπ‘Ÿπ‘œπ‘”π‘Žπ‘›π‘§π‘Ž [𝑂𝑁𝐿𝐼𝑁𝐸]" #NOME ON
  3. OFF = "π΄π‘Ÿπ‘Ÿπ‘œπ‘”π‘Žπ‘›π‘§π‘Ž [𝑂𝐹𝐹𝐿𝐼𝑁𝐸]" #NOME OFF
  4. autoReplyPvt = None
  5.  
  6. async def getAutoReply():
  7.   global autoReplyPvt
  8.   global OFF
  9.   if (await bot.get_me()).first_name == OFF:
  10.     autoReplyPvt = True
  11.   else:
  12.     autoReplyPvt = False
  13.  
  14. loop = asyncio.get_event_loop()
  15. loop.run_until_complete(getAutoReply())
  16.  
  17. @register(outgoing=True, pattern="^[.]on$")
  18. async def changeNameON(e):
  19.   global ON
  20.   global autoReplyPvt
  21.   await bot(UpdateProfileRequest(first_name=ON, last_name=""))
  22.   autoReplyPvt = False
  23.   await e.edit("βœ… Nome Cambiato Correttamente! βœ… [ORA SEI ONLINE]")
  24.  
  25. @register(outgoing=True, pattern="^[.]off$")
  26. async def changeNameOFF(e):
  27.   global OFF
  28.   global autoReplyPvt
  29.   global autoReplyLOGGER_GROUP
  30.   global OFF
  31.   await bot(UpdateProfileRequest(first_name=OFF, last_name=""))
  32.   autoReplyPvt = True
  33.   await e.edit("βœ… Nome Cambiato Correttamente! βœ… [ORA SEI OFFLINE]")
  34.  
  35. @register(incoming=True)
  36. async def autoReply(e):
  37.   if e.is_private and not (await e.get_sender()).bot:
  38.     global mutedList
  39.     if e.chat_id in mutedList:
  40.       await e.delete()
  41.     else:
  42.       global autoReplyPvt
  43.       if autoReplyPvt:
  44.         if type((await e.client.get_me()).status).__name__ ==  "UserStatusOffline":
  45.           await e.respond(message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement