From 4baef4de09ca451a7b2fb56bf922f875995edf50 Mon Sep 17 00:00:00 2001 From: kolay Date: Sat, 3 Oct 2020 17:53:35 +0300 Subject: [PATCH] replaced return None with error Co-authored-by: Lonami --- telethon/client/chats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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')