Skip to content

Commit

Permalink
Replace multiple == checks with in (#11)
Browse files Browse the repository at this point in the history
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
  • Loading branch information
Ryomen-Sukuna and deepsource-autofix[bot] committed Oct 11, 2021
2 parents ab82504 + b8de2d0 commit 918e4d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion zeldris/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def is_chat_allowed(update, context):
context.bot.leave_chat(chat_id)
finally:
raise DispatcherHandlerStop
if len(WHITELIST_CHATS) != 0 and len(BLACKLIST_CHATS) != 0:
if 0 not in (len(WHITELIST_CHATS), len(BLACKLIST_CHATS)):
chat_id = update.effective_message.chat_id
if chat_id in BLACKLIST_CHATS:
context.bot.send_message(
Expand Down
12 changes: 3 additions & 9 deletions zeldris/modules/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ def weather(update, context):
del_msg.delete()
update.effective_message.delete()
except BadRequest as err:
if (err.message == "Message to delete not found") or (
err.message == "Message can't be deleted"
):
if err.message in ("Message to delete not found", "Message can't be deleted"):
return

return
Expand All @@ -65,9 +63,7 @@ def weather(update, context):
del_msg.delete()
update.effective_message.delete()
except BadRequest as err:
if (err.message == "Message to delete not found") or (
err.message == "Message can't be deleted"
):
if err.message in ("Message to delete not found", "Message can't be deleted"):
return
return

Expand Down Expand Up @@ -128,9 +124,7 @@ def fahr(c):
del_msg.delete()
update.effective_message.delete()
except BadRequest as err:
if (err.message == "Message to delete not found") or (
err.message == "Message can't be deleted"
):
if err.message in ("Message to delete not found", "Message can't be deleted"):
return


Expand Down

0 comments on commit 918e4d5

Please sign in to comment.