windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
262 stars 116 forks source link

Add language for setMyCommands #189

Closed temkagordin closed 3 years ago

temkagordin commented 3 years ago

Hi, can you pls add language parameter for this new feature ? image

Just add inputs with languages parameter and set in setMyCommands image

windkh commented 3 years ago

ok

windkh commented 3 years ago

@temkagordin ... are you aware of the fact the the language_code is set for all commands? You can not have different language codes for single commands.

windkh commented 3 years ago

Second question: do you want to enter the string with the language code in the configuration node?

temkagordin commented 3 years ago

"@temkagordin ... are you aware of the fact the the language_code is set for all commands? You can not have different language codes for single commands." Yes i know

"Second question: do you want to enter the string with the language code in the configuration node? Yes, you are most likely right, it is better to configure these parameters in the configuration node

windkh commented 3 years ago

@temkagordin Well, if I would also introduce the scope parameter then it would be possible to call setMyCommands several times as every scope could have its own language. But as far as I understood you want to assign a language to all commands. Only the default scope should be used right now.

--> I will add this as soon as i have time.

windkh commented 3 years ago

@temkagordin I made some experiments and found out the following: (see also https://core.telegram.org/bots/api#botcommandscope)

You can define commands for different scopes and different languages. Whenever the user types / to get a list of commands telegram will return a filtered list that depends on the scope and the language of the user. My conclusion is: you can define a command in "en" english: /run and call setMyCommands. and at the same time define the same command in another language like "de" german: /renne and call setMyCommands again.

The english user will get /run while the german user will get /renne in his command list. So the language code is at first language dependent and second scope dependent.

Now the problem: I could not find a way to edit the language specific commands using @BotFather.

windkh commented 3 years ago

fixed in 9.6.0

temkagordin commented 3 years ago

thanks a lot, everything works excellent 😊