Skip to content

Commit

Permalink
chore: fix error event has no attr from_user
Browse files Browse the repository at this point in the history
  • Loading branch information
dantetemplar committed Nov 19, 2024
1 parent ff0faca commit 1a87879
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bot/middlewares.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async def __call__(
data: Dict[str, Any],
) -> Any:
lang = self.default_lang
if event.from_user:
if hasattr(event, "from_user") and event.from_user:
lang = event.from_user.language_code

l10n = self.l10ns[lang]
Expand Down

0 comments on commit 1a87879

Please sign in to comment.