Add basic moderator commands

This commit is contained in:
2025-08-23 00:02:10 -03:00
parent 8868b18be3
commit eaa38f3474
27 changed files with 752 additions and 249 deletions
+10 -3
View File
@@ -64,7 +64,7 @@ where
fn build(&self, id: Option<String>) -> TwilightComponent {
TwilightComponent::Button(TwilightButton {
custom_id: id,
disabled: false,
disabled: self.disabled(),
emoji: None,
label: self.label().map(|i| i.to_string()),
style: if self.url().is_none() {
@@ -95,16 +95,23 @@ where
None
}
}
fn style(&self) -> ButtonStyle {
ButtonStyle::Secondary
}
fn label(&self) -> Option<&'static str> {
fn label(&self) -> Option<String> {
None
}
fn url(&self) -> Option<&'static str> {
fn url(&self) -> Option<String> {
None
}
fn disabled(&self) -> bool {
false
}
async fn on_press(&self, ctx: InteractionContext<S, E>) -> Result<(), InteractionError> {
ctx.defer().await
}