Want to contribute? Fork me on Codeberg.org!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
605 B

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::<ShardManagerContainer>() {
msg.reply(ctx, "Good night!").await?;
manager.lock().await.shutdown_all().await;
} else {
3 years ago
msg.reply(ctx, "There was a problem getting the shard manager")
.await?;
return Ok(());
}
Ok(())
3 years ago
}