From 8e6fced543735aa4c68e70221518a37c36780d59 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 01:08:08 +0100 Subject: commands: gate admin, trigger, cron and recording behind permissions --- src/commands/trigger.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/commands/trigger.rs') diff --git a/src/commands/trigger.rs b/src/commands/trigger.rs index 2a33528..3a91edd 100644 --- a/src/commands/trigger.rs +++ b/src/commands/trigger.rs @@ -11,6 +11,8 @@ type Context<'a> = poise::Context<'a, Data, Error>; /// Trigger keyword management #[poise::command( slash_command, + guild_only, + required_permissions = "MANAGE_GUILD", subcommands("create", "add", "remove", "delete", "list", "help",) )] pub async fn trigger(_ctx: Context<'_>) -> Result<()> { @@ -18,7 +20,7 @@ pub async fn trigger(_ctx: Context<'_>) -> Result<()> { } /// Create a new trigger group -#[poise::command(slash_command)] +#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")] pub async fn create( ctx: Context<'_>, #[description = "Logical group name"] @@ -38,7 +40,7 @@ pub async fn create( } /// Add keywords and/or responses to a trigger group -#[poise::command(slash_command)] +#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")] pub async fn add( ctx: Context<'_>, #[description = "Existing group name"] @@ -79,7 +81,7 @@ pub async fn add( } /// Remove keyword or response from a group -#[poise::command(slash_command)] +#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")] pub async fn remove( ctx: Context<'_>, #[description = "Group name"] @@ -110,7 +112,7 @@ pub async fn remove( } /// Delete an entire trigger group -#[poise::command(slash_command)] +#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")] pub async fn delete( ctx: Context<'_>, #[description = "Group name"] @@ -128,7 +130,7 @@ pub async fn delete( } /// List keywords and responses for a group -#[poise::command(slash_command)] +#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")] pub async fn list( ctx: Context<'_>, #[description = "Group name"] @@ -178,7 +180,7 @@ pub async fn list( } /// Display trigger command usage info -#[poise::command(slash_command)] +#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")] pub async fn help(ctx: Context<'_>) -> Result<()> { let help = [ "**Trigger Commands**", -- cgit v1.2.3