Skip to content

Commit

Permalink
Compare booleans with is instead of with ==
Browse files Browse the repository at this point in the history
  • Loading branch information
AlberLC committed Jun 27, 2022
1 parent 988cf2d commit 9221384
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions multibot/bots/multi_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def decorator(func: Callable) -> Callable:
@find_message
async def wrapper(self: MultiBot, message: Message):
message = message
if is_ == message.author.is_admin or message.chat.is_private:
if is_ is message.author.is_admin or message.chat.is_private:
return await func(self, message)
await self.accept_button_event(message)
if send_negative:
Expand All @@ -89,7 +89,7 @@ def decorator(func: Callable) -> Callable:
@functools.wraps(func)
@find_message
async def wrapper(self: MultiBot, message: Message):
if is_ == self.is_bot_mentioned(message):
if is_ is self.is_bot_mentioned(message):
return await func(self, message)
await self.accept_button_event(message)

Expand All @@ -104,7 +104,7 @@ def decorator(func: Callable) -> Callable:
@functools.wraps(func)
@find_message
async def wrapper(self: MultiBot, message: Message):
if is_ == message.chat.is_group:
if is_ is message.chat.is_group:
return await func(self, message)
await self.accept_button_event(message)

Expand All @@ -130,7 +130,7 @@ def decorator(func: Callable) -> Callable:
@functools.wraps(func)
@find_message
async def wrapper(self: MultiBot, message: Message):
if message.is_inline is None or is_ == message.is_inline:
if message.is_inline is None or is_ is message.is_inline:
return await func(self, message)
await self.accept_button_event(message)

Expand Down Expand Up @@ -243,7 +243,7 @@ def decorator(func: Callable) -> Callable:
@functools.wraps(func)
@find_message
async def wrapper(self: MultiBot, message: Message):
if is_ == bool(message.replied_message):
if is_ is bool(message.replied_message):
return await func(self, message)
await self.accept_button_event(message)

Expand Down
2 changes: 1 addition & 1 deletion multibot/bots/telegram_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def user_client(func_: Callable = None, /, is_=True) -> Callable:
def decorator(func: Callable) -> Callable:
@functools.wraps(func)
async def wrapper(self: TelegramBot, *args, **kwargs):
if is_ == bool(self.user_client):
if is_ is bool(self.user_client):
return await func(self, *args, **kwargs)

return wrapper
Expand Down

0 comments on commit 9221384

Please sign in to comment.