Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
telethon get if participant is admin
from import ChannelParticipantCreator, ChannelParticipantAdmin
from import GetParticipantRequest
async def handler(event):
participant = await client(GetParticipantRequest(channel=event.original_update.message.to_id.channel_id,user_id=event.original_update.message.from_id))
isadmin = (type(participant.participant) == ChannelParticipantAdmin)
iscreator = (type(participant.participant) == ChannelParticipantCreator)
print(isadmin, iscreator)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment