1
0
Fork 0
mirror of https://gitlab.com/niansa/SomeBot.git synced 2025-03-06 20:48:26 +01:00

Added permission check to embed creation

This commit is contained in:
niansa 2022-11-05 18:17:22 +01:00
parent a02e0c7bcf
commit 2e1ca53412

View file

@ -28,6 +28,11 @@ public:
.add_option(dpp::command_option(dpp::command_option_type::co_string, "color", "Farbe", false))
.add_option(dpp::command_option(dpp::command_option_type::co_string, "footer_text", "Fußzeilen-Test", false))
.add_option(dpp::command_option(dpp::command_option_type::co_string, "footer_image", "Fußzeilen-Bild", false))), [&](const dpp::slashcommand_t& event) {
// Check that user has the correct permissions
if (!event.command.get_guild().base_permissions(event.command.member).has(dpp::permissions::p_manage_messages)) {
event.reply(dpp::message("Du braucht die Nachrichtenwaltungsberechtigung, um dieses Kommando zu verwenden.").set_flags(dpp::message_flags::m_ephemeral));
return;
}
// Get color
unsigned color = Util::str_to_color(strOrEmpty(event.get_parameter("color")));
// Generate embed