Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. from telethon.tl.functions.contacts import UnblockRequest
  2.  
  3. unblockMessage = "**Sei stato sbloccato lollzzss**"
  4.  
  5. @register(outgoing=True, pattern="^.unblock$")
  6. async def unblockUser(e):
  7.   if not e.text[0].isalpha():
  8.     if not (await e.get_sender()).bot:
  9.       global unblockMessage
  10.       if e.is_reply:
  11.         reply = await e.get_reply_message()
  12.         await e.delete()
  13.         await e.client.send_message(reply.chat_id, unblockMessage, reply_to=reply)
  14.         await e.client(UnblockRequest(reply.sender.id))
  15.       else:
  16.         if e.is_private:
  17.           await e.edit(unblockMessage)
  18.           await e.client(UnblockRequest(e.chat_id))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement