diff --git a/telethon/client/chats.py b/telethon/client/chats.py index 55d6494f..06d77294 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -1184,7 +1184,7 @@ class ChatMethods: for participant in chat.participants.participants: if participant.user_id == user.id: return custom.ParticipantPermissions(participant.participant, True) - return None + raise errors.UserNotParticipantError(None) raise ValueError('You must pass either a channel or a chat')