Fixed locale when sending as a chat

This commit is contained in:
Profitroll 2023-08-23 10:34:45 +02:00
parent 9e00d38877
commit dfd39f47db
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2

View File

@ -117,6 +117,8 @@ class PyroGroup:
def select_locale( def select_locale(
self, app: PyroClient, user: User, ignore_auto: bool = False self, app: PyroClient, user: User, ignore_auto: bool = False
) -> str: ) -> str:
if user is None:
return app.default_locale
if not ignore_auto and self.locale_auto is True: if not ignore_auto and self.locale_auto is True:
if user.language_code is not None: if user.language_code is not None:
return user.language_code return user.language_code