mirror of
https://github.com/MedzikUser/servers
synced 2024-08-14 23:57:48 +00:00
25c2f0baa3
- Fixed add one to next ID - Added command /id - Added `id` field to Client struct
26 lines
512 B
Rust
26 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()
|
|
}
|
|
}
|