Add support for extras, conditionally displaying commands in the help command, and start working on moderation commands
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
use std::error::Error;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use twilight_model::user::User;
|
||||
|
||||
use crate::framework::runtime::Runtime;
|
||||
|
||||
#[async_trait]
|
||||
pub trait ExtrasGetter<S>: Send + Sync {
|
||||
type Extras;
|
||||
|
||||
async fn get_extra(
|
||||
&self,
|
||||
user: &User,
|
||||
rt: &Runtime<S, Self::Extras>,
|
||||
) -> Result<Self::Extras, Box<dyn Error>>;
|
||||
}
|
||||
|
||||
pub struct DefaultExtraGetter;
|
||||
|
||||
#[async_trait]
|
||||
impl<S> ExtrasGetter<S> for DefaultExtraGetter {
|
||||
type Extras = ();
|
||||
|
||||
async fn get_extra(
|
||||
&self,
|
||||
_user: &User,
|
||||
_rt: &Runtime<S, Self::Extras>,
|
||||
) -> Result<Self::Extras, Box<dyn Error>> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user