You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2b-rs/src/commands/misc/shutdown.rs

20 lines
559 B
Rust

use crate::commands::common::handle_autodelete;
use serenity::framework::standard::macros::command;
use serenity::framework::standard::CommandResult;
use serenity::model::channel::Message;
use serenity::prelude::*;
use std::process;
#[command]
#[description("Shutdown")]
#[usage("")]
#[owners_only]
async fn shutdown(ctx: &Context, msg: &Message) -> CommandResult {
log::info!("Shutting down...");
msg.channel_id
.say(ctx, ":night_with_stars: Good night ....")
.await?;
handle_autodelete(ctx, msg).await?;
process::exit(0);
}