Command Description Installation
The command description is needed to add a command to the list of bot commands in Telegram. Evogram allows setting the command description in various languages in the settings, and then automatically installing all the commands in the bot with localization taken into account.
To set the command description, use the following method:
@CommandHandler({
name: "example",
description: [{
text: "This is a test command",
language: "en"
}, {
text: "Это тестовая команда",
language: "ru"
}]
})
In this example, we have set descriptions in two languages, English and Russian. Now, when using the bot, users will see the appropriate description depending on their language settings in Telegram.
The description
parameter is an array containing the text
value and an optional language
parameter. The text
sets the description for the command, while language
specifies the language for the command description.
This example only sets the command description in English and Russian. If the user has a different language setting in Telegram, they will not see the command in the list of commands. In this case, you need to write a separate description without specifying the language.