diff --git a/euphoxide-bot/examples/examplebot.rs b/euphoxide-bot/examples/examplebot.rs index b862965..95d1a25 100644 --- a/euphoxide-bot/examples/examplebot.rs +++ b/euphoxide-bot/examples/examplebot.rs @@ -29,22 +29,22 @@ async fn main() { let (event_tx, mut event_rx) = mpsc::channel(10); let commands = Commands::::new() - .then(Ping::default().general("ping").hidden()) - .then(Ping::default().specific("ping").hidden()) + .then(Ping::default().general("ping").with_info_hidden()) + .then(Ping::default().specific("ping").with_info_hidden()) .then( ShortHelp::new("/me demonstrates how to use euphoxide") .general("help") - .hidden(), + .with_info_hidden(), ) .then( FullHelp::new() .with_after("Created using euphoxide.") .specific("help") - .hidden(), + .with_info_hidden(), ) .then( FromHandler::new(pyramid) - .described() + .with_info() .with_description("build a pyramid") .general("pyramid"), ) diff --git a/euphoxide-bot/src/command.rs b/euphoxide-bot/src/command.rs index d7150fe..32228fb 100644 --- a/euphoxide-bot/src/command.rs +++ b/euphoxide-bot/src/command.rs @@ -8,7 +8,7 @@ use std::{future::Future, sync::Arc}; use async_trait::async_trait; use bang::{General, Global, Specific}; -use basic::{Described, Prefixed}; +use basic::{Prefixed, WithInfo}; use euphoxide::{ api::{self, Data, Message, MessageId, SendEvent, SendReply}, client::{ @@ -121,12 +121,12 @@ pub trait Command { } pub trait CommandExt: Sized { - fn described(self) -> Described { - Described::new(self) + fn with_info(self) -> WithInfo { + WithInfo::new(self) } - fn hidden(self) -> Described { - Described::hidden(self) + fn with_info_hidden(self) -> WithInfo { + WithInfo::hidden(self) } fn prefixed(self, prefix: impl ToString) -> Prefixed { diff --git a/euphoxide-bot/src/command/basic.rs b/euphoxide-bot/src/command/basic.rs index 9d91cf1..51804d9 100644 --- a/euphoxide-bot/src/command/basic.rs +++ b/euphoxide-bot/src/command/basic.rs @@ -8,13 +8,13 @@ use euphoxide::api::Message; use super::{Command, Context, Info, Propagate}; /// Rewrite or hide command info. -pub struct Described { +pub struct WithInfo { pub inner: C, pub trigger: Option>, pub description: Option>, } -impl Described { +impl WithInfo { pub fn new(inner: C) -> Self { Self { inner, @@ -51,7 +51,7 @@ impl Described { } #[async_trait] -impl Command for Described +impl Command for WithInfo where C: Command + Sync, {