Skip to content

Commit

Permalink
fix(localization): force PRIVATE ChatType for InlineQueries
Browse files Browse the repository at this point in the history
Telegram recently started to report the chat type BOT for inline queries made at a bot chat, which broke our localization logic.
It's just better to force PRIVATE chat type, since there's no information about the actual chat.
  • Loading branch information
alissonlauffer committed Jun 15, 2024
1 parent 414239a commit 408048e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eduu/utils/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def get_lang(message: CallbackQuery | Message | InlineQuery) -> str:
chat_type = message.chat.type
elif isinstance(message, InlineQuery):
chat = message.from_user
chat_type = message.chat_type
chat_type = ChatType.PRIVATE
else:
raise TypeError(f"Update type '{message.__name__}' is not supported.")

Expand Down

0 comments on commit 408048e

Please sign in to comment.