PaulSonOfLars / tgbot

Modular telegram group management bot
GNU General Public License v3.0
723 stars 920 forks source link

Database error for user IDs with 10 digits #110

Closed Kabyss closed 2 years ago

Kabyss commented 2 years ago

Seeing the following error for accounts with new 10 digit user ID system. Accounts that have 9 or less digit user IDs are working fine. probably related to https://core.telegram.org/bots/api#march-9-2021, where it says

user identifiers can now have up to 52 significant bits and require a 64-bit integer or double-precision float type to be stored safely.

Could you please suggest a solution?

Example error details-

sqlalchemy.exc.DataError: (psycopg2.errors.NumericValueOutOfRange) integer out of range

[SQL: INSERT INTO afk_users (user_id, is_afk, reason) VALUES (%(user_id)s, %(is_afk)s, %(reason)s)] [parameters: {'user_id': 1234567890, 'is_afk': True, 'reason': 'test'}] (Background on this error at: https://sqlalche.me/e/14/9h9h)

PaulSonOfLars commented 2 years ago

As mentioned in the readme, this project is no longer maintained. There has been no work to add support for any of the new features or breaking changes added to the bot API over the past few years, and as such, there are no guarantees on anything working as expected.

As you've noted, this is an issue to do with user IDs now being larger than 32bits. I recommend you fix this in your own code - You can find examples of how to do this in #109.

Kabyss commented 2 years ago

Thanks for the response and the hint, it was helpful in fixing the issue.