Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Create a dictionary that has a key in the form of some kind of phrase designation, say start_message
. Its value is two dictionaries, one with the key RU, the other EN, or whatever. Initially, you ask the user what language is needed, save his choice. In the future, when receiving a message from the user, select the appropriate element from the dictionary
messages = {'start_message': {'ru': 'Привет', 'en': 'Hello'}}
@bot.message_handler()
def start_message(message):
bot.send_message(message.chat.id, messages['start_message'][user_locale])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question