servers/src/commands/disconnect.rs

27 lines
512 B
Rust

use crate::plugins::prelude::*;
pub struct Disconnect;
#[async_trait]
impl Command for Disconnect {
fn name(&self) -> &'static str {
"/disconnect"
}
fn aliases(&self) -> Vec<&'static str> {
vec!["/close", "/exit"]
}
fn help(&self) -> &'static str {
"Close the connection"
}
fn usage(&self) -> &'static str {
"/disconnect"
}
async fn execute(&self, client: &Client, _args: Vec<&str>) -> anyhow::Result<()> {
client.close()
}
}