From f471d4caefff51d49b69551412f4859d99f674a2 Mon Sep 17 00:00:00 2001 From: salmonik Date: Fri, 6 Nov 2026 21:34:53 +0100 Subject: revert required permissions Signed-off-by: salmonik --- src/commands/cron.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/commands/cron.rs') diff --git a/src/commands/cron.rs b/src/commands/cron.rs index ec5b702..809d1a4 100644 --- a/src/commands/cron.rs +++ b/src/commands/cron.rs @@ -12,7 +12,6 @@ type Context<'a> = poise::Context<'a, Data, Error>; #[poise::command( slash_command, guild_only, - required_permissions = "MANAGE_GUILD", subcommands("dodaj_audio", "dodaj_wiadomość", "pokaż", "usuń", "pauza", "wznów",) )] pub async fn cron(_ctx: Context<'_>) -> Result<()> { @@ -20,7 +19,7 @@ pub async fn cron(_ctx: Context<'_>) -> Result<()> { } /// Schedule audio playback -#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")] +#[poise::command(slash_command, guild_only)] pub async fn dodaj_audio( ctx: Context<'_>, #[description = "Cron expression (e.g. \"37 21 * * *\" = every day at 21:37)"] cron_expression: String, @@ -75,7 +74,7 @@ pub async fn dodaj_audio( } /// Schedule a periodic message -#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")] +#[poise::command(slash_command, guild_only)] pub async fn dodaj_wiadomość( ctx: Context<'_>, #[description = "Cron expression (e.g. \"37 21 * * *\" = every day at 21:37)"] cron_expression: String, @@ -109,7 +108,7 @@ pub async fn dodaj_wiadomość( } /// List all cron jobs -#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")] +#[poise::command(slash_command, guild_only)] pub async fn pokaż(ctx: Context<'_>) -> Result<()> { let guild_id = ctx.guild_id().ok_or_else(lang::err_not_in_guild)?; let jobs = database::list_cron_jobs(&ctx.data().db_pool, guild_id.get() as i64).await?; @@ -144,7 +143,7 @@ pub async fn pokaż(ctx: Context<'_>) -> Result<()> { } /// Remove a cron job -#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")] +#[poise::command(slash_command, guild_only)] pub async fn usuń( ctx: Context<'_>, #[description = "ID pracy do usunięcia"] job_id: i64, @@ -159,13 +158,15 @@ pub async fn usuń( } /// Pause a cron job -#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")] +#[poise::command(slash_command, guild_only)] pub async fn pauza( ctx: Context<'_>, #[description = "ID pracy do zapauzowania"] job_id: i64, ) -> Result<()> { let guild_id = ctx.guild_id().ok_or_else(lang::err_not_in_guild)?; - if database::set_cron_job_active(&ctx.data().db_pool, job_id, guild_id.get() as i64, false).await? { + if database::set_cron_job_active(&ctx.data().db_pool, job_id, guild_id.get() as i64, false) + .await? + { ctx.say(lang::fmt_cron_paused(job_id)).await?; } else { ctx.say(lang::fmt_cron_not_found(job_id)).await?; @@ -174,13 +175,15 @@ pub async fn pauza( } /// Resume a paused cron job -#[poise::command(slash_command, guild_only, required_permissions = "MANAGE_GUILD")] +#[poise::command(slash_command, guild_only)] pub async fn wznów( ctx: Context<'_>, #[description = "ID pracy cron do wznowienia"] job_id: i64, ) -> Result<()> { let guild_id = ctx.guild_id().ok_or_else(lang::err_not_in_guild)?; - if database::set_cron_job_active(&ctx.data().db_pool, job_id, guild_id.get() as i64, true).await? { + if database::set_cron_job_active(&ctx.data().db_pool, job_id, guild_id.get() as i64, true) + .await? + { ctx.say(lang::fmt_cron_resumed(job_id)).await?; } else { ctx.say(lang::fmt_cron_not_found(job_id)).await?; -- cgit v1.2.3