From 7ba9e10f0fb11ebe4382460b527a593ee36d5700 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Fri, 17 Apr 2020 19:21:54 +0200 Subject: [PATCH] Fix admin detection in _can_use_commands --- mautrix_telegram/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mautrix_telegram/bot.py b/mautrix_telegram/bot.py index 56072f76..b7645048 100644 --- a/mautrix_telegram/bot.py +++ b/mautrix_telegram/bot.py @@ -147,7 +147,7 @@ async def _can_use_commands(self, chat: TypePeer, tgid: TelegramID) -> bool: 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