diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/mod.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs index 2e01104..1219793 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -39,7 +39,6 @@ pub use CACHE; use http; use internal::prelude::*; -use model::id::UserId; use parking_lot::Mutex; use self::bridge::gateway::{ShardManager, ShardManagerMonitor, ShardManagerOptions}; use std::sync::Arc; @@ -277,10 +276,6 @@ pub struct Client { pub threadpool: ThreadPool, /// The token in use by the client. pub token: Arc<Mutex<String>>, - /// The ID of the user for this client. - /// - /// This is retrieved when the client is created using the given token. - pub user_id: UserId, /// URI that the client's shards will use to connect to the gateway. /// /// This is likely not important for production usage and is, at best, used @@ -332,8 +327,6 @@ impl Client { }; http::set_token(&token); - let user_id = http::get_current_user()?.id; - let locked = Arc::new(Mutex::new(token)); let name = "serenity client".to_owned(); @@ -368,7 +361,6 @@ impl Client { shard_manager, shard_manager_worker, threadpool, - user_id, }) } @@ -807,8 +799,10 @@ impl Client { // This also acts as a form of check to ensure the token is correct. #[cfg(all(feature = "standard_framework", feature = "framework"))] { + let user = http::get_current_user()?; + if let Some(ref mut framework) = *self.framework.lock() { - framework.update_current_user(self.user_id); + framework.update_current_user(user.id); } } |