aboutsummaryrefslogtreecommitdiff
path: root/src/client/bridge/gateway/shard_manager.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-01-18 09:09:06 -0800
committerZeyla Hellyer <[email protected]>2018-01-18 09:09:06 -0800
commitba112ccb7d3b1d524b29a999f21624cfa356cffa (patch)
treec9d86eb546b12f131532a36d3fad49c6a02501bf /src/client/bridge/gateway/shard_manager.rs
parentUse an InterMessage to communicate over gateway (diff)
downloadserenity-ba112ccb7d3b1d524b29a999f21624cfa356cffa.tar.xz
serenity-ba112ccb7d3b1d524b29a999f21624cfa356cffa.zip
Expose a client voice manager
Diffstat (limited to 'src/client/bridge/gateway/shard_manager.rs')
-rw-r--r--src/client/bridge/gateway/shard_manager.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/bridge/gateway/shard_manager.rs b/src/client/bridge/gateway/shard_manager.rs
index ea3ad1e..b62ff00 100644
--- a/src/client/bridge/gateway/shard_manager.rs
+++ b/src/client/bridge/gateway/shard_manager.rs
@@ -20,6 +20,8 @@ use typemap::ShareMap;
#[cfg(feature = "framework")]
use framework::Framework;
+#[cfg(feature = "voice")]
+use client::bridge::voice::ClientVoiceManager;
/// A manager for handling the status of shards by starting them, restarting
/// them, and stopping them when required.
@@ -40,6 +42,11 @@ use framework::Framework;
///
/// # use std::error::Error;
/// #
+/// # #[cfg(feature = "voice")]
+/// # use serenity::client::bridge::voice::ClientVoiceManager;
+/// # #[cfg(feature = "voice")]
+/// # use serenity::model::id::UserId;
+/// #
/// # #[cfg(feature = "framework")]
/// # fn try_main() -> Result<(), Box<Error>> {
/// #
@@ -78,6 +85,8 @@ use framework::Framework;
/// shard_total: 5,
/// token: &token,
/// threadpool,
+/// # #[cfg(feature = "voice")]
+/// # voice_manager: &Arc::new(Mutex::new(ClientVoiceManager::new(0, UserId(0)))),
/// ws_url: &gateway_url,
/// });
/// # Ok(())
@@ -135,6 +144,8 @@ impl ShardManager {
rx: shard_queue_rx,
threadpool: opt.threadpool,
token: Arc::clone(opt.token),
+ #[cfg(feature = "voice")]
+ voice_manager: Arc::clone(opt.voice_manager),
ws_url: Arc::clone(opt.ws_url),
};
@@ -343,5 +354,7 @@ pub struct ShardManagerOptions<'a, H: EventHandler + Send + Sync + 'static> {
pub shard_total: u64,
pub threadpool: ThreadPool,
pub token: &'a Arc<Mutex<String>>,
+ #[cfg(feature = "voice")]
+ pub voice_manager: &'a Arc<Mutex<ClientVoiceManager>>,
pub ws_url: &'a Arc<Mutex<String>>,
}