Add support for extras, conditionally displaying commands in the help command, and start working on moderation commands

This commit is contained in:
2025-08-22 18:06:52 -03:00
parent 55ae1c8937
commit 8868b18be3
41 changed files with 1075 additions and 368 deletions
+32
View File
@@ -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(())
}
}