Skip to content

Commit

Permalink
slash commands
Browse files Browse the repository at this point in the history
  • Loading branch information
cycle-five committed Sep 13, 2024
1 parent dbd8eff commit 05c6e3b
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion crack-core/src/commands/settings/get/get_welcome_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ use crate::utils::get_guild_name;
use crate::{Context, Error};

#[cfg(not(tarpaulin_include))]
#[poise::command(category = "Settings", slash_command, prefix_command, owners_only)]
#[poise::command(
category = "Settings",
slash_command,
prefix_command,
required_permissions = "ADMINISTRATOR"
)]
pub async fn welcome_settings(ctx: Context<'_>) -> Result<(), Error> {
let guild_id = ctx.guild_id().unwrap();
let welcome_settings = {
Expand Down
2 changes: 1 addition & 1 deletion crack-core/src/commands/settings/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::Error;

/// Add an additional prefix to the bot for the current guild.
#[cfg(not(tarpaulin_include))]
#[poise::command(prefix_command, guild_only, owners_only)]
#[poise::command(slash_command, prefix_command, guild_only, owners_only)]
pub async fn add_prefix(
ctx: Context<'_>,
#[description = "The prefix to add to the bot"] prefix: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use serenity::model::id::ChannelId;
/// Set a log channel for a specific guild.
#[poise::command(
category = "Settings",
slash_command,
prefix_command,
required_permissions = "ADMINISTRATOR",
required_bot_permissions = "SEND_MESSAGES"
Expand Down
1 change: 1 addition & 0 deletions crack-core/src/commands/settings/set/set_auto_role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::{
/// Set the auto role for the server.
#[poise::command(
category = "Settings",
slash_command,
prefix_command,
required_permissions = "ADMINISTRATOR",
required_bot_permissions = "MANAGE_ROLES"
Expand Down
1 change: 1 addition & 0 deletions crack-core/src/commands/settings/set/set_idle_timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use poise::CreateReply;
#[cfg(not(tarpaulin_include))]
#[poise::command(
category = "Settings",
slash_command,
prefix_command,
aliases("set_idle_timeout"),
required_permissions = "ADMINISTRATOR"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use serenity::all::Channel;
/// Set the join-leave log channel.
#[poise::command(
category = "Settings",
slash_command,
prefix_command,
required_permissions = "ADMINISTRATOR",
required_bot_permissions = "SEND_MESSAGES"
Expand Down
1 change: 1 addition & 0 deletions crack-core/src/commands/settings/set/set_music_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use serenity::all::Channel;

#[poise::command(
category = "Settings",
slash_command,
prefix_command,
required_permissions = "ADMINISTRATOR",
required_bot_permissions = "SEND_MESSAGES"
Expand Down
1 change: 1 addition & 0 deletions crack-core/src/commands/settings/set/set_volume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub async fn set_volume(
#[poise::command(
category = "Settings",
slash_command,
prefix_command,
required_permissions = "ADMINISTRATOR"
)]
pub async fn volume(
Expand Down
2 changes: 2 additions & 0 deletions crack-core/src/commands/settings/set/set_welcome_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use serenity::all::{Channel, GuildId, Role};
#[poise::command(
category = "Settings",
prefix_command,
slash_command,
required_permissions = "ADMINISTRATOR",
required_bot_permissions = "SEND_MESSAGES|MANAGE_ROLES"
)]
Expand Down Expand Up @@ -48,6 +49,7 @@ pub async fn password_verify(
#[poise::command(
category = "Settings",
prefix_command,
slash_command,
required_permissions = "ADMINISTRATOR",
required_bot_permissions = "SEND_MESSAGES|MANAGE_ROLES"
)]
Expand Down
2 changes: 2 additions & 0 deletions crack-core/src/commands/settings/toggle/toggle_autopause.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use sqlx::PgPool;

/// Toggle autopause for the bot
#[poise::command(
category = "Settings",
slash_command,
prefix_command,
rename = "autopause",
required_permissions = "ADMINISTRATOR"
Expand Down

0 comments on commit 05c6e3b

Please sign in to comment.