NicoNex / echotron

An elegant and concurrent library for the Telegram bot API in Go.
https://t.me/s/echotronnews
GNU Lesser General Public License v3.0
363 stars 26 forks source link

Wrong ChatID after marshaling #29

Closed vildan-valeev closed 1 year ago

vildan-valeev commented 1 year ago

I wrote couple tests for CommandOptions type for setMyCommands method...

https://github.com/vildan-valeev/hotron/blob/master/querybuilder_test.go#L36

When ChatID is 0101010, after call scan() func and getting url.Values, chat_id will be 0101010, but it's - 33288.

NicoNex commented 1 year ago

The problem here is that when you write 0101010 since it starts with a 0 Go lexer assumes that it's a number with base 8, in fact 0101010 base 8 equals to 33288 base 10. So everything is working as expected.