Skip to content

Commit

Permalink
Precalculate list of channel IDs to get info for to fix #393
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jan 11, 2020
1 parent b0e60e6 commit 80ff9d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mautrix_telegram/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ async def post_login(self) -> None:
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]))
Expand Down

0 comments on commit 80ff9d0

Please sign in to comment.