Basically just an example on how to switch the language of your bot dynamically.
tgcrypto
for faster crypto,
Async Pyrogram (to run the actual bot) and
Plate to chose the correct language files.
As per the documentation of Pyrogram and Plate.
Keep in mind that you will need Telegram API Keys and a Bot Token for Pyrogram.
Upon start we just check if the user is already in our dictionary that consists of a user_id and their chosen language code (e.g. "de_DE"
for German).
If they are not yet in this dictionary, we simply send a message asking for their language and present a ReplyKeyboard with Emoji representing the
languages they can choose from. Then we just have a MessageHandler that catches the Unicode points of the Emoji and add their user_id and their chosen language code to the dictionary. Afterwards we can just rely on this value. If you need, you can add more or different languages.
I'm not licensing this at all. Do as you please. Credit is highly appreciated, but not required.
If you want to add more or different languages, refer to Plate's documentation (or rather its Readme lol).