diff options
| author | Austin Hellyer <[email protected]> | 2016-12-16 21:40:45 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-12-16 21:40:45 -0800 |
| commit | 86cd00f20d6f218e524deed040d3c209f0361a86 (patch) | |
| tree | d6a8af5cd0ba426db2e7308f5791e06f964dbb00 /src/client | |
| parent | Make 'voice' feature not require 'cache' (diff) | |
| download | serenity-86cd00f20d6f218e524deed040d3c209f0361a86.tar.xz serenity-86cd00f20d6f218e524deed040d3c209f0361a86.zip | |
Remove cache feature dependency for framework
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/mod.rs | 12 |
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) { |