-
Notifications
You must be signed in to change notification settings - Fork 0
Custom language code function
sushka edited this page Aug 12, 2023
·
1 revision
async def force_ukrainian_language(user: User, bot: Bot) -> str:
force_list = [733876760]
if user.id in force_list:
return "uk" # Set force ukrainian language for account with 733876760 id
else:
return user.language_code
translator = Translator(extract_language_function=force_ukrainian_language)
This function must have 2 arguments with types User and Bot and return str.