Advertisement
disk6969

Telethon force noforwards

Oct 1st, 2023 (edited)
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. from telethon.tl.functions import messages
  2.  
  3. def no_forwards(self, *args, **kwargs):
  4.   kwargs['noforwards'] = True
  5.   self.original_init(*args, **kwargs)
  6.  
  7. for req in ['SendMultiMediaRequest', 'SendMediaRequest', 'SendMessageRequest', 'ForwardMessagesRequest']:
  8.     cls = getattr(messages, req)
  9.     cls.original_init = cls.__init__
  10.     cls.__init__ = no_forwards
  11.  
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement