Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. blockMessage = "MESSAGGIO DI BLOCCO QUI"
  2.  
  3. from telethon.tl.functions.contacts import BlockRequest
  4.  
  5. @register(outgoing=True, pattern="^[.]block$")
  6. async def blockUser(e):
  7.   if not (await e.get_sender()).bot:
  8.     global blockMessage
  9.     if e.is_reply:
  10.       reply = await e.get_reply_message()
  11.       await e.delete()
  12.       await e.client.send_message(reply.chat_id, blockMessage, reply_to=reply)
  13.       await e.client(BlockRequest(reply.sender.id))
  14.     else:
  15.       if e.is_private:
  16.         await e.edit(blockMessage)
  17.         await e.client(BlockRequest(e.chat_id))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement