diff options
| author | Zeyla Hellyer <[email protected]> | 2018-04-27 08:05:56 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2018-05-27 19:40:36 -0700 |
| commit | d94f6bd13fed8275c9c0c75b3a5d651e79365b95 (patch) | |
| tree | 836f8c169174b709af34e132e84da8ae8eeb14fe /src/model | |
| parent | Make builders mutably borrowed (diff) | |
| download | serenity-d94f6bd13fed8275c9c0c75b3a5d651e79365b95.tar.xz serenity-d94f6bd13fed8275c9c0c75b3a5d651e79365b95.zip | |
Add Rich Presence parsing support
Adds support for parsing Rich Presences.
This can not be used for setting activities with bots.
Upgrade path:
Basically change your import and usage from
`serenity::model::gateway::Game` to
`serenity::model::gateway::Activity`.
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/gateway.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/model/gateway.rs b/src/model/gateway.rs index 1584633..385902a 100644 --- a/src/model/gateway.rs +++ b/src/model/gateway.rs @@ -295,14 +295,15 @@ pub struct ActivitySecrets { pub spectate: Option<String>, } -#[derive(Clone, Copy, Debug)] +/// The type of an activity. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] pub enum ActivityType { /// An indicator that the user is playing a game. - Playing = 0, + Playing, /// An indicator that the user is streaming to a service. - Streaming = 1, + Streaming, /// An indicator that the user is listening to something. - Listening = 2, + Listening, } enum_number!( @@ -405,12 +406,12 @@ impl<'de> Deserialize<'de> for Presence { .map_err(DeError::custom)?; Ok(Presence { - activity: activity, - last_modified: last_modified, - nick: nick, - status: status, - user: user, - user_id: user_id, + activity, + last_modified, + nick, + status, + user, + user_id, }) } } |