From 80ff9d0f667df0921aeaff44d6e7b0ba4aab7faf Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 11 Jan 2020 20:07:21 +0200 Subject: [PATCH] Precalculate list of channel IDs to get info for to fix #393 --- mautrix_telegram/bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mautrix_telegram/bot.py b/mautrix_telegram/bot.py index de2c1143..56072f76 100644 --- a/mautrix_telegram/bot.py +++ b/mautrix_telegram/bot.py @@ -108,9 +108,9 @@ class Bot(AbstractUser): if isinstance(chat, ChatForbidden) or chat.left or chat.deactivated: self.remove_chat(TelegramID(chat.id)) - channel_ids = (InputChannel(chat_id, 0) + channel_ids = [InputChannel(chat_id, 0) for chat_id, chat_type in self.chats.items() - if chat_type == "channel") + if chat_type == "channel"] for channel_id in channel_ids: try: await self.client(GetChannelsRequest([channel_id]))