polyphony-chat / chorus

A Rust library for interacting with multiple Polyphony- and Spacebar-Compatible instances at once.
https://crates.io/crates/chorus
Mozilla Public License 2.0
16 stars 7 forks source link

Add serde impl for DateTime<Utc> from a string #500

Closed Quat3rnion closed 4 months ago

Quat3rnion commented 4 months ago
kozabrada123 commented 4 months ago

Thanks, I'll review this later today when I have time

kozabrada123 commented 4 months ago

Looking at the tests though, seems there might a deserialization error in some (Ready?) gateway events

kozabrada123 commented 4 months ago

I'm sorry, I think you might've misunderstood; Discord uses ISO8601 timestamps as string (e. g. "2024-01-02T13:18:46.923000+00:00"), not unix epoch timestamps as strings Not parsing them as DateTimes was just an issue of not setting the right type, not needing a special serde implementation

Quat3rnion commented 4 months ago

Oh, I definitely misunderstood. I guess I missed the 'iso' in your message. I'll go ahead and close this and revert that stuff

kozabrada123 commented 4 months ago

Sorry about that, looks like I made you do a bunch of work for nothing :woozy_face:

kozabrada123 commented 4 months ago

Actully, funny thing is Discord does use this type of timestamps for one specific thing, so this implementation is useful, just not for those types. The place in question is literally one ratelimit header, X-RateLimit-Reset

Quat3rnion commented 4 months ago

Well, at least it wasn't all for nothing then lol