Skip to content

Commit

Permalink
Fix NoneType (whois) (UsergeTeam#147)
Browse files Browse the repository at this point in the history
* Fix NoneType

* Update whois.py

Co-authored-by: rking32 <[email protected]>
  • Loading branch information
Phyco-Ninja and rking32 authored Sep 3, 2020
1 parent df9862b commit 1473925
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion userge/plugins/fun/whois.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async def who_is(message: Message):
message_out_str += f"<a href='tg://user?id={from_user.id}'>{from_user.first_name}</a>"

s_perm = True
if hasattr(message.chat, 'permissions'):
if message.chat.permissions:
s_perm = bool(message.chat.permissions.can_send_media_messages)
if from_user.photo and s_perm:
local_user_photo = await message.client.download_media(
Expand Down

0 comments on commit 1473925

Please sign in to comment.