Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrasnitski committed Feb 8, 2025
1 parent 6461973 commit 0a10181
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
27 changes: 1 addition & 26 deletions src/gateway/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,41 +442,16 @@ pub struct Client {
/// # use std::time::Duration;
/// #
/// # fn run(client: Client) {
/// // Create a clone of the `Arc` containing the shard manager.
/// let shard_manager = client.shard_manager.clone();
///
/// tokio::spawn(async move {
/// loop {
/// let count = shard_manager.shards_instantiated().await.len();
/// let count = client.shard_manager.shards_instantiated().len();
/// println!("Shard count instantiated: {}", count);
///
/// tokio::time::sleep(Duration::from_millis(5000)).await;
/// }
/// });
/// # }
/// ```
///
/// Shutting down all connections after one minute of operation:
///
/// ```rust,no_run
/// # use serenity::prelude::*;
/// # use std::time::Duration;
/// #
/// # fn run(client: Client) {
/// // Create a clone of the `Arc` containing the shard manager.
/// let shard_manager = client.shard_manager.clone();
///
/// // Create a thread which will sleep for 60 seconds and then have the shard manager
/// // shutdown.
/// tokio::spawn(async move {
/// tokio::time::sleep(Duration::from_secs(60)).await;
///
/// shard_manager.shutdown_all().await;
///
/// println!("Shutdown shard manager!");
/// });
/// # }
/// ```
pub shard_manager: ShardManager,
/// The voice manager for the client.
///
Expand Down
2 changes: 1 addition & 1 deletion src/gateway/sharding/shard_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl ShardManager {
/// use serenity::model::id::ShardId;
/// use serenity::prelude::*;
///
/// # async fn run(client: Client) {
/// # async fn run(mut client: Client) {
/// // restart shard ID 7
/// client.shard_manager.restart(ShardId(7)).await;
/// # }
Expand Down

0 comments on commit 0a10181

Please sign in to comment.