32 lines
797 B
Rust
32 lines
797 B
Rust
use crate::commands::{Command, RequestType};
|
|
use crate::context::Context;
|
|
use crate::Result;
|
|
use geoffrey_models::models::parameters::EmptyRequest;
|
|
use geoffrey_models::models::player::Player;
|
|
use geoffrey_models::models::settings::GeoffreySettings;
|
|
use geoffrey_models::models::CommandLevel;
|
|
use std::sync::Arc;
|
|
|
|
pub struct Settings {}
|
|
|
|
impl Command for Settings {
|
|
type Req = EmptyRequest;
|
|
type Resp = GeoffreySettings;
|
|
|
|
fn command_name() -> String {
|
|
"settings".to_string()
|
|
}
|
|
|
|
fn request_type() -> RequestType {
|
|
RequestType::GET
|
|
}
|
|
|
|
fn command_level() -> CommandLevel {
|
|
CommandLevel::ALL
|
|
}
|
|
|
|
fn run_command(ctx: Arc<Context>, _: &Self::Req, _: Option<Player>) -> Result<Self::Resp> {
|
|
Ok(ctx.cfg.geoffrey_settings.clone())
|
|
}
|
|
}
|