Replace multiple == checks with in (#10)

* Replace multiple `==` checks with `in`

* Format code with black and isort

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: yasirarism <55983182+yasirarism@users.noreply.github.com>
This commit is contained in:
deepsource-autofix[bot] 2023-01-10 20:22:29 +07:00 committed by GitHub
parent 0dbab68a39
commit a3410caac1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -453,7 +453,7 @@ async def prvt_msg(_, c_q):
user_id, flname, sender_id, msg = PRVT_MSGS[msg_id]
if c_q.from_user.id == user_id or c_q.from_user.id == sender_id:
if c_q.from_user.id in (user_id, sender_id):
await c_q.answer(msg, show_alert=True)
else:
await c_q.answer(f"only {flname} can see this Private Msg!", show_alert=True)
@ -469,7 +469,7 @@ async def destroy_msg(_, c_q):
user_id, flname, sender_id, msg = PRVT_MSGS[msg_id]
if c_q.from_user.id == user_id or c_q.from_user.id == sender_id:
if c_q.from_user.id in (user_id, sender_id):
del PRVT_MSGS[msg_id]
by = "receiver" if c_q.from_user.id == user_id else "sender"
await c_q.edit_message_text(f"This secret message is ☠destroyed☠ by msg {by}")

View file

@ -140,9 +140,9 @@ async def kang_sticker(c, m):
if "image" in reply.document.mime_type:
# mime_type: image/webp
resize = True
elif (
MessageMediaType.VIDEO == reply.document.mime_type
or MessageMediaType.ANIMATION == reply.document.mime_type
elif reply.document.mime_type in (
MessageMediaType.VIDEO,
MessageMediaType.ANIMATION,
):
# mime_type: application/video
videos = True