aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-12-16 21:40:45 -0800
committerAustin Hellyer <[email protected]>2016-12-16 21:40:45 -0800
commit86cd00f20d6f218e524deed040d3c209f0361a86 (patch)
treed6a8af5cd0ba426db2e7308f5791e06f964dbb00 /src/client
parentMake 'voice' feature not require 'cache' (diff)
downloadserenity-86cd00f20d6f218e524deed040d3c209f0361a86.tar.xz
serenity-86cd00f20d6f218e524deed040d3c209f0361a86.zip
Remove cache feature dependency for framework
Diffstat (limited to 'src/client')
-rw-r--r--src/client/mod.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs
index c9a9c65..b0193b3 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -768,6 +768,18 @@ impl Client {
//
// Not all shards need to be initialized in this process.
fn start_connection(&mut self, shard_data: Option<[u8; 3]>) -> Result<()> {
+ // Update the framework's current user if the feature is enabled.
+ //
+ // This also acts as a form of check to ensure the token is correct.
+ #[cfg(feature="framework")]
+ {
+ let user = rest::get_current_user()?;
+
+ self.framework.lock()
+ .unwrap()
+ .update_current_user(user.id, user.bot);
+ }
+
let gateway_url = rest::get_gateway()?.url;
for i in 0..shard_data.map_or(1, |x| x[1] + 1) {