Rename Described to WithInfo
This commit is contained in:
parent
3571a97fb2
commit
c2eeacac52
3 changed files with 13 additions and 13 deletions
|
|
@ -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<E = euphoxide::Error> {
|
|||
}
|
||||
|
||||
pub trait CommandExt: Sized {
|
||||
fn described(self) -> Described<Self> {
|
||||
Described::new(self)
|
||||
fn with_info(self) -> WithInfo<Self> {
|
||||
WithInfo::new(self)
|
||||
}
|
||||
|
||||
fn hidden(self) -> Described<Self> {
|
||||
Described::hidden(self)
|
||||
fn with_info_hidden(self) -> WithInfo<Self> {
|
||||
WithInfo::hidden(self)
|
||||
}
|
||||
|
||||
fn prefixed(self, prefix: impl ToString) -> Prefixed<Self> {
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ use euphoxide::api::Message;
|
|||
use super::{Command, Context, Info, Propagate};
|
||||
|
||||
/// Rewrite or hide command info.
|
||||
pub struct Described<C> {
|
||||
pub struct WithInfo<C> {
|
||||
pub inner: C,
|
||||
pub trigger: Option<Option<String>>,
|
||||
pub description: Option<Option<String>>,
|
||||
}
|
||||
|
||||
impl<C> Described<C> {
|
||||
impl<C> WithInfo<C> {
|
||||
pub fn new(inner: C) -> Self {
|
||||
Self {
|
||||
inner,
|
||||
|
|
@ -51,7 +51,7 @@ impl<C> Described<C> {
|
|||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<E, C> Command<E> for Described<C>
|
||||
impl<E, C> Command<E> for WithInfo<C>
|
||||
where
|
||||
C: Command<E> + Sync,
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue