slack-rs / slack-rs-api

Rust interface for the Slack Web API
Apache License 2.0
109 stars 66 forks source link

Timestamp type #84

Closed dten closed 4 years ago

dten commented 4 years ago

Looking for some feedback.

have added a timestamp.json object to the schema and referenced it places that are timestamps https://github.com/dten/slack-api-schemas/tree/timestamp

and in api updated the generator to cope with it, but in fact ignored that type and provided a custom Timestamp type that converts everything to f64 https://github.com/dten/slack-rs-api/tree/timestamp

added a couple of tests also, there's a test if SLACK_API_TOKEN is set it will try list the channels and then try get the history for the first 10. This was failing before the changes because the timestamps in the message details were often the wrong type

it's pretty similar to #56 but more complete

dten commented 4 years ago

I tried actually using it and the fact that it was an f64 which lacks Eq and Hash became a problem. Swapped it for micro seconds

dten commented 4 years ago

been using this successfully for a couple of months, gonna merge it