Advertisement
disk6969

approved groups

Oct 13th, 2023 (edited)
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. from pyrogram.utils import get_peer_id
  2. from pyrogram.raw.types import (
  3.   UpdateNewChannelMessage,
  4.   UpdateNewMessage,
  5.   MessageService,
  6.   MessageActionChatJoinedByRequest as approved_service
  7. )
  8.  
  9. @Client.on_raw_update()
  10. async def handle_payment(client, update, _, __):
  11.     if not isinstance(update, (UpdateNewChannelMessage, UpdateNewMessage)): return
  12.     if not isinstance(msg:= update.message, MessageService): return
  13.     if not isinstance(service:= update.message.action, approved_service): return
  14.     if msg.out:
  15.         print('Got Approved in:', get_peer_id(msg.peer_id))
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement