Skip to content

Commit

Permalink
refactor: change tuple to dict for in checks
Browse files Browse the repository at this point in the history
  • Loading branch information
donBarbos committed Jan 10, 2025
1 parent 7ba580a commit 0927762
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot/middlewares/channel_subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def _is_subscribed(self, bot: Bot, user_id: int) -> bool:
except TelegramNotFound:
return False

if member.status in (ChatMemberStatus.LEFT, ChatMemberStatus.KICKED, ChatMemberStatus.RESTRICTED):
if member.status in {ChatMemberStatus.LEFT, ChatMemberStatus.KICKED, ChatMemberStatus.RESTRICTED}:
return False

elif isinstance(self.chat_ids, (str, int)):
Expand All @@ -55,7 +55,7 @@ async def _is_subscribed(self, bot: Bot, user_id: int) -> bool:
except TelegramNotFound:
return False

if member.status in (ChatMemberStatus.LEFT, ChatMemberStatus.KICKED):
if member.status in {ChatMemberStatus.LEFT, ChatMemberStatus.KICKED}:
return False

return True

1 comment on commit 0927762

@ames0k0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a set... nvm

- 258 BUILD_TUPLE              3
+ 258 BUILD_SET                3

Please sign in to comment.