Merge pull request #468 from davidmehren/fix-peerchannel-admin
Fix admin detection in _can_use_commands
This commit is contained in:
@@ -147,7 +147,7 @@ class Bot(AbstractUser):
|
|||||||
if self.whitelist_group_admins:
|
if self.whitelist_group_admins:
|
||||||
if isinstance(chat, PeerChannel):
|
if isinstance(chat, PeerChannel):
|
||||||
p = await self.client(GetParticipantRequest(chat, tgid))
|
p = await self.client(GetParticipantRequest(chat, tgid))
|
||||||
return isinstance(p, (ChannelParticipantCreator, ChannelParticipantAdmin))
|
return isinstance(p.participant, (ChannelParticipantCreator, ChannelParticipantAdmin))
|
||||||
elif isinstance(chat, PeerChat):
|
elif isinstance(chat, PeerChat):
|
||||||
chat = await self.client(GetFullChatRequest(chat.chat_id))
|
chat = await self.client(GetFullChatRequest(chat.chat_id))
|
||||||
participants = chat.full_chat.participants.participants
|
participants = chat.full_chat.participants.participants
|
||||||
|
|||||||
Reference in New Issue
Block a user