Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pyrogram.utils import get_peer_id
- from pyrogram.raw.types import (
- UpdateNewChannelMessage,
- UpdateNewMessage,
- MessageService,
- MessageActionChatJoinedByRequest as approved_service
- )
- @Client.on_raw_update()
- async def handle_payment(client, update, _, __):
- if not isinstance(update, (UpdateNewChannelMessage, UpdateNewMessage)): return
- if not isinstance(msg:= update.message, MessageService): return
- if not isinstance(service:= update.message.action, approved_service): return
- if msg.out:
- print('Got Approved in:', get_peer_id(msg.peer_id))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement