use super::{Command, Execution, ExecutionResult}; use crate::context::Context; use crate::help::HelpTopic; use async_trait::async_trait; pub struct HelpCommand(pub Option); #[async_trait] impl Command for HelpCommand { fn name(&self) -> &'static str { "help information" } fn is_secure(&self) -> bool { false } async fn execute(&self, _ctx: &Context<'_>) -> ExecutionResult { let help = match &self.0 { Some(topic) => topic.message(), _ => "There is no help for this topic", }; let html = format!("Help: {}", help.replace("\n", "
")); Execution::success(html) } }