2022-08-12 20:32:22 +00:00
|
|
|
use crate::plugins::prelude::*;
|
2022-07-29 19:55:21 +00:00
|
|
|
|
2022-08-12 20:32:22 +00:00
|
|
|
pub struct Disconnect;
|
2022-07-29 19:55:21 +00:00
|
|
|
|
|
|
|
#[async_trait]
|
2022-08-12 20:32:22 +00:00
|
|
|
impl Command for Disconnect {
|
2022-07-29 19:55:21 +00:00
|
|
|
fn name(&self) -> &'static str {
|
|
|
|
"/disconnect"
|
|
|
|
}
|
|
|
|
|
2022-08-12 20:32:22 +00:00
|
|
|
fn aliases(&self) -> Vec<&'static str> {
|
|
|
|
vec!["/close", "/exit"]
|
|
|
|
}
|
|
|
|
|
2022-07-29 19:55:21 +00:00
|
|
|
fn help(&self) -> &'static str {
|
2022-08-12 20:32:22 +00:00
|
|
|
"Close the connection"
|
|
|
|
}
|
|
|
|
|
|
|
|
fn usage(&self) -> &'static str {
|
|
|
|
"/disconnect"
|
2022-07-29 19:55:21 +00:00
|
|
|
}
|
|
|
|
|
2022-08-12 20:32:22 +00:00
|
|
|
async fn execute(&self, client: &Client, _args: Vec<&str>) -> anyhow::Result<()> {
|
2022-08-12 20:52:47 +00:00
|
|
|
client.close()
|
2022-07-29 19:55:21 +00:00
|
|
|
}
|
|
|
|
}
|