FIX: keep order of commands, better docs
Came across some difficulties when used layout, one of that is commands usage:
every restart I have different set of commands, owning to it is map (made it list) not obvious to find way of templating commands (added to example.yml) and tests not obvious how to use SetCommands for all not specified locales (added it in layout docstring)
Previous try https://github.com/tucnak/telebot/pull/681
@dvordrova I meant the fact that Commands is exposed but doesn't execute the commands as a template, which leads to the raw description content. What would I use it for?
https://github.com/tucnak/telebot/pull/681/files/d9dcbb41bfee07192e91c90fc9d4d3eba7b1ddfc#diff-36c59fae7f0af10b179a0e3781fe9ea9d14c5e5a99d6a36a1f24767010bca403R43
What would I use it for?
@demget so you wouldn't
it is just test representation of comment I added // "commands" must be not templates
https://github.com/tucnak/telebot/pull/738/files#diff-cf94c60ab5f782ca8ed34204c5b19bb3e07930bf1379544b47b236ec9d315eb0R179
Possible ways to resolve it I see
- either to make different settings file where commands are not templated and different test with
Commands() - or keep this test that shows that using this function can lead to raw templates in data you get from settings file
Which one do you prefer?
b.SetCommands([]tb.Command{{Text: "test", Description: "test"}}, "", tb.CommandScopeDefault)
log.Println(b.Commands()) //[] <nil>
//why empty?
Is this expected behaviour?