replaced return None with error

Co-authored-by: Lonami <totufals@hotmail.com>
This commit is contained in:
kolay 2020-10-03 17:53:35 +03:00 committed by GitHub
parent 603772650e
commit 4baef4de09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')