aboutsummaryrefslogtreecommitdiffstats
path: root/src/commands/trigger.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/trigger.rs')
-rw-r--r--src/commands/trigger.rs14
1 files changed, 8 insertions, 6 deletions
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>;
11/// Trigger keyword management 11/// Trigger keyword management
12#[poise::command( 12#[poise::command(
13 slash_command, 13 slash_command,
14 guild_only,
15 required_permissions = "MANAGE_GUILD",
14 subcommands("create", "add", "remove", "delete", "list", "help",) 16 subcommands("create", "add", "remove", "delete", "list", "help",)
15)] 17)]
16pub async fn trigger(_ctx: Context<'_>) -> Result<()> { 18pub async fn trigger(_ctx: Context<'_>) -> Result<()> {
@@ -18,7 +20,7 @@ pub async fn trigger(_ctx: Context<'_>) -> Result<()> {
18} 20}
19 21
20/// Create a new trigger group 22/// Create a new trigger group
21#[poise::command(slash_command)] 23#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")]
22pub async fn create( 24pub async fn create(
23 ctx: Context<'_>, 25 ctx: Context<'_>,
24 #[description = "Logical group name"] 26 #[description = "Logical group name"]
@@ -38,7 +40,7 @@ pub async fn create(
38} 40}
39 41
40/// Add keywords and/or responses to a trigger group 42/// Add keywords and/or responses to a trigger group
41#[poise::command(slash_command)] 43#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")]
42pub async fn add( 44pub async fn add(
43 ctx: Context<'_>, 45 ctx: Context<'_>,
44 #[description = "Existing group name"] 46 #[description = "Existing group name"]
@@ -79,7 +81,7 @@ pub async fn add(
79} 81}
80 82
81/// Remove keyword or response from a group 83/// Remove keyword or response from a group
82#[poise::command(slash_command)] 84#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")]
83pub async fn remove( 85pub async fn remove(
84 ctx: Context<'_>, 86 ctx: Context<'_>,
85 #[description = "Group name"] 87 #[description = "Group name"]
@@ -110,7 +112,7 @@ pub async fn remove(
110} 112}
111 113
112/// Delete an entire trigger group 114/// Delete an entire trigger group
113#[poise::command(slash_command)] 115#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")]
114pub async fn delete( 116pub async fn delete(
115 ctx: Context<'_>, 117 ctx: Context<'_>,
116 #[description = "Group name"] 118 #[description = "Group name"]
@@ -128,7 +130,7 @@ pub async fn delete(
128} 130}
129 131
130/// List keywords and responses for a group 132/// List keywords and responses for a group
131#[poise::command(slash_command)] 133#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")]
132pub async fn list( 134pub async fn list(
133 ctx: Context<'_>, 135 ctx: Context<'_>,
134 #[description = "Group name"] 136 #[description = "Group name"]
@@ -178,7 +180,7 @@ pub async fn list(
178} 180}
179 181
180/// Display trigger command usage info 182/// Display trigger command usage info
181#[poise::command(slash_command)] 183#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")]
182pub async fn help(ctx: Context<'_>) -> Result<()> { 184pub async fn help(ctx: Context<'_>) -> Result<()> {
183 let help = [ 185 let help = [
184 "**Trigger Commands**", 186 "**Trigger Commands**",