refactor: merge isinstance calls (#302)

You can pass a tuple of types you want to check as the second argument to `isinstance`. If the object matches with any of the types, it will return `True` else `False`.

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
deepsource-autofix[bot] 2024-07-30 11:50:31 +07:00 committed by GitHub
parent 88558990d0
commit 0bc0e91688
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,7 +54,7 @@ def get_locale_string(
async def get_lang(message) -> str:
if isinstance(message, CallbackQuery):
chat = message.message.chat
elif isinstance(message, Message) or isinstance(message, ChatMemberUpdated):
elif isinstance(message, (Message, ChatMemberUpdated)):
chat = message.chat
elif isinstance(message, InlineQuery):
chat, chat.type = message.from_user, ChatType.PRIVATE