SpaceManiac / discord-rs

Rust library for the Discord chat client API
MIT License
390 stars 94 forks source link

Parse integer Game types within strings #84

Closed ghost closed 8 years ago

ghost commented 8 years ago

The gateway does not validate the value of a Game. Any field can be of any type, more or less. Although we might not care about a Game type being a float, checking for a string would fix some decoding errors, as other libraries might erroneously send the Game's type field as an integer within a string.

This will fix errors like:

[Warning] Receive error: Decode("Expected valid GameType", "1")
[Warning] Receive error: Decode("Expected valid GameType", "0")