Fix admin detection in _can_use_commands

This commit is contained in:
David Mehren
2020-04-17 19:21:54 +02:00
parent 05e966011e
commit 7ba9e10f0f
+1 -1
View File
@@ -147,7 +147,7 @@ class Bot(AbstractUser):
if self.whitelist_group_admins:
if isinstance(chat, PeerChannel):
p = await self.client(GetParticipantRequest(chat, tgid))
return isinstance(p, (ChannelParticipantCreator, ChannelParticipantAdmin))
return isinstance(p.participant, (ChannelParticipantCreator, ChannelParticipantAdmin))
elif isinstance(chat, PeerChat):
chat = await self.client(GetFullChatRequest(chat.chat_id))
participants = chat.full_chat.participants.participants