Open liquidnya opened 3 years ago
Twitch does not specify the numeric bounds for those types. Being that most of their system speaks JSON, ideally those should be i64 (which matches the integer
type most JSON implementations use (including serde_json)).
Its a mistake on my end to have u64
s there. I intentionally used i64
but there has been some oversight. There isn't really any schema or spec to follow, so I'm just going off the cuff and hoping things stay relatively the same. I highly doubt Twitch would ever send a negative id, but my types->json
would require a conversion, likely.
I agree they should all be the same type. I would prefer they be u64
s but there is a sound reason for them to be i64
s.
The
user_id
inIdentity::Full
has the typei64
, but otherroom_id
anduser_id
functions of messages e.g.Privmsg::user_id
usesu64
as the user id type.When comparing the user_id or room_id with the bot identity user_id I have to convert between the types and handle the error cases:
i64::MAX
If there are no negative user ids I suggest changing the type of
user_id
inIdentity::Full
tou64
.