use serenity::framework::standard::{macros::command, CommandResult}; use serenity::model::prelude::*; use serenity::prelude::*; use crate::ShardManagerContainer; #[command] #[owners_only] async fn sleep(ctx: &Context, msg: &Message) -> CommandResult { let data = ctx.data.read().await; if let Some(manager) = data.get::() { msg.reply(ctx, "Good night!").await?; manager.lock().await.shutdown_all().await; } else { msg.reply(ctx, "There was a problem getting the shard manager") .await?; return Ok(()); } Ok(()) }