diff options
| author | Zeyla Hellyer <[email protected]> | 2017-06-10 21:55:33 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-06-10 21:55:33 -0700 |
| commit | d0b64cd64a18a6116267fa09a837d62c19cced42 (patch) | |
| tree | fc68a0891ea0ddd8187c38f289c8a9ccddc07e8c /src/model/channel | |
| parent | Fix voice compilation (diff) | |
| download | serenity-d0b64cd64a18a6116267fa09a837d62c19cced42.tar.xz serenity-d0b64cd64a18a6116267fa09a837d62c19cced42.zip | |
Fix negative nonces failing to deserialize
Negative message nonces caused deserialization errors, as serde would
not deserialize integers into strings.
To fix this, change `Message::nonce` into an `Option<Snowflake>` from an
`Option<String>`. This new `Snowflake` is a wrapper around an `i64`. Use
a new `I64Visitor` to deserialize i64s, u64s, and strs into the wanted
i64.
Diffstat (limited to 'src/model/channel')
| -rw-r--r-- | src/model/channel/message.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/model/channel/message.rs b/src/model/channel/message.rs index e092703..930c046 100644 --- a/src/model/channel/message.rs +++ b/src/model/channel/message.rs @@ -48,7 +48,7 @@ pub struct Message { /// Array of users mentioned in the message. pub mentions: Vec<User>, /// Non-repeating number used for ensuring message order. - pub nonce: Option<String>, + pub nonce: Option<Snowflake>, /// Indicator of whether the message is pinned. pub pinned: bool, /// Array of reactions performed on the message. |