feat(commands/moderation): updating the clear to be on help menu
This commit is contained in:
parent
5cd072e0e7
commit
87e8467daf
1 changed files with 27 additions and 17 deletions
|
|
@ -1,25 +1,24 @@
|
|||
use crate::commands::{CommandEntry, SlashCommand};
|
||||
use std::sync::atomic::AtomicU64;
|
||||
|
||||
use crate::commands::{CommandCategory, CommandEntry, SlashCommand};
|
||||
use crate::config::EmojiConfig;
|
||||
|
||||
use serenity::all::{
|
||||
ChannelType,
|
||||
CommandInteraction,
|
||||
CommandOption,
|
||||
CommandOptionType,
|
||||
Context,
|
||||
CreateCommand,
|
||||
CreateCommandOption,
|
||||
CreateInteractionResponse,
|
||||
CreateInteractionResponseMessage,
|
||||
EditInteractionResponse,
|
||||
GetMessages,
|
||||
Message,
|
||||
MessageId,
|
||||
Permissions
|
||||
CommandInteraction, CommandOption, CommandOptionType, Context, CreateCommand, CreateCommandOption, CreateInteractionResponse, CreateInteractionResponseMessage, EditInteractionResponse, GetMessages, InteractionContext, Message, MessageId, Permissions
|
||||
};
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub struct Clear;
|
||||
pub struct Clear {
|
||||
pub command_id: AtomicU64,
|
||||
}
|
||||
|
||||
impl Clear {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
command_id: AtomicU64::new(0),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[serenity::async_trait]
|
||||
impl SlashCommand for Clear {
|
||||
|
|
@ -31,6 +30,14 @@ impl SlashCommand for Clear {
|
|||
"Clear X message (X given in the parameters)"
|
||||
}
|
||||
|
||||
fn category(&self) -> &'static CommandCategory {
|
||||
&CommandCategory::Moderation
|
||||
}
|
||||
|
||||
fn command_id_ref(&self) -> &AtomicU64 {
|
||||
&self.command_id
|
||||
}
|
||||
|
||||
fn register(&self) -> CreateCommand {
|
||||
println!("\t✅ | {}", self.name());
|
||||
let mut options: Vec<CreateCommandOption> = Vec::new();
|
||||
|
|
@ -45,6 +52,9 @@ impl SlashCommand for Clear {
|
|||
.description(self.description())
|
||||
.default_member_permissions(Permissions::MANAGE_MESSAGES)
|
||||
.set_options(options)
|
||||
.contexts(vec![
|
||||
InteractionContext::Guild,
|
||||
])
|
||||
}
|
||||
|
||||
async fn run(
|
||||
|
|
@ -91,5 +101,5 @@ impl SlashCommand for Clear {
|
|||
}
|
||||
|
||||
inventory::submit! {
|
||||
CommandEntry { create: || Box::new(Clear) }
|
||||
CommandEntry { create: || Box::new(Clear::new()) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue