mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 09:44:50 +00:00
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:
parent
88558990d0
commit
0bc0e91688
1 changed files with 1 additions and 1 deletions
|
|
@ -54,7 +54,7 @@ def get_locale_string(
|
||||||
async def get_lang(message) -> str:
|
async def get_lang(message) -> str:
|
||||||
if isinstance(message, CallbackQuery):
|
if isinstance(message, CallbackQuery):
|
||||||
chat = message.message.chat
|
chat = message.message.chat
|
||||||
elif isinstance(message, Message) or isinstance(message, ChatMemberUpdated):
|
elif isinstance(message, (Message, ChatMemberUpdated)):
|
||||||
chat = message.chat
|
chat = message.chat
|
||||||
elif isinstance(message, InlineQuery):
|
elif isinstance(message, InlineQuery):
|
||||||
chat, chat.type = message.from_user, ChatType.PRIVATE
|
chat, chat.type = message.from_user, ChatType.PRIVATE
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue