aboutsummaryrefslogtreecommitdiff
path: root/src/client/context.rs
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-10-19 17:39:57 -0700
committerAustin Hellyer <[email protected]>2016-10-20 06:38:34 -0700
commitecb95b511448ec409f3bf4b2677129a5bee7a82c (patch)
tree5167d07d9034f9d0a77818c4821d8e184f20bec1 /src/client/context.rs
parentInitial commit (diff)
downloadserenity-ecb95b511448ec409f3bf4b2677129a5bee7a82c.tar.xz
serenity-ecb95b511448ec409f3bf4b2677129a5bee7a82c.zip
Add ability to fully set a presence
The full presence setting allows for manually specifying the online status and afk field.
Diffstat (limited to 'src/client/context.rs')
-rw-r--r--src/client/context.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/client/context.rs b/src/client/context.rs
index 6f28a75..6402e9b 100644
--- a/src/client/context.rs
+++ b/src/client/context.rs
@@ -780,7 +780,18 @@ impl Context {
}
pub fn set_game(&self, game: Option<Game>) {
- self.connection.lock().unwrap().set_game(game)
+ self.connection.lock()
+ .unwrap()
+ .set_presence(game, OnlineStatus::Online, false);
+ }
+
+ pub fn set_presence(&self,
+ game: Option<Game>,
+ status: OnlineStatus,
+ afk: bool) {
+ self.connection.lock()
+ .unwrap()
+ .set_presence(game, status, afk)
}
pub fn start_guild_prune<G>(&self, guild_id: G, days: u16)