From 8884fd2876ee9d66c092b0f3d7d69bfa31ed37b7 Mon Sep 17 00:00:00 2001 From: Syping Date: Mon, 19 Feb 2024 20:55:10 +0100 Subject: [PATCH] fix if condition --- src/slashcommands.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slashcommands.cpp b/src/slashcommands.cpp index e16a51c..da729a8 100644 --- a/src/slashcommands.cpp +++ b/src/slashcommands.cpp @@ -34,7 +34,7 @@ void bot::slashcommands::process_edit_command(dpp::cluster *bot, bot::settings:: { try { dpp::permission user_permissions = event.command.get_resolved_permission(event.command.usr.id); - if (user_permissions.has(dpp::p_manage_webhooks)) + if (!user_permissions.has(dpp::p_manage_webhooks)) throw dpp::exception("Unauthorized to use command"); dpp::command_interaction interaction = event.command.get_command_interaction(); @@ -231,7 +231,7 @@ void bot::slashcommands::process_translate_command(dpp::cluster *bot, bot::setti { try { dpp::permission user_permissions = event.command.get_resolved_permission(event.command.usr.id); - if (user_permissions.has(dpp::p_manage_webhooks)) + if (!user_permissions.has(dpp::p_manage_webhooks)) throw dpp::exception("Unauthorized to use command"); std::variant v_target;