ba0f3 / telebot.nim

Async Telegram Bot API Client implement in @Nim-Lang
MIT License
165 stars 24 forks source link

Fix library when using 32-bit architectures #73

Closed ghost closed 2 years ago

ghost commented 2 years ago

Before this change, telebot would crash because in unmarshal in utils it's using getInt which uses architecture's native int size, but Telegram has some types that are 64-bit, so the code needs to use getBiggestInt instead.

Also changed the code so that it does a type conversion instead of a cast which is safer.

I'm not sure if there are any other bugs regarding 32-bit compatibility, but with this one the basic echo bot at least works fine.

ba0f3 commented 2 years ago

Thank you!