dariotarantini / vgram

Telegram Bot library written in V.
MIT License
144 stars 19 forks source link

IDs should be i64s, not ints. #18

Open km19809 opened 1 year ago

km19809 commented 1 year ago

According to doc, IDs and file sizes are at most 52 bits.

This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

So they should be i64, not an int(32 bits integer).

The full list:

  1. User.id
  2. Chat.id
  3. Message.migrate_to_chat_id
  4. Message.migrate_from_chat_id
  5. Animation.file_size
  6. Audio.file_size
  7. Document.file_size
  8. Video.file_size
  9. Voice.file_size
  10. Contact.user_id
  11. UserShared.user_id
  12. ChatShared.user_id
  13. File.file_size
  14. ChatJoinRequest.user_chat_id
  15. ResponseParameters.migrate_to_chat_id

Should I make a PR for this?