mirror of
https://gitlab.com/niansa/SomeBot.git
synced 2025-03-06 20:48:26 +01:00
Check for administrator permissions when executing eval command
This commit is contained in:
parent
e4e89d60a2
commit
44180757ad
1 changed files with 5 additions and 0 deletions
|
@ -634,6 +634,11 @@ class Custom {
|
|||
public:
|
||||
Custom(Bot *_bot) : bot(_bot) {
|
||||
bot->add_messagecommand(Bot::MessageCommand({"Evaluate"}, "Evaluiere Lua code"), [&](const dpp::message_context_menu_t& event) {
|
||||
// Check that user has the correct permissions
|
||||
if (!event.command.get_guild().base_permissions(event.command.member).has(dpp::permissions::p_administrator)) {
|
||||
event.reply(dpp::message("Du musst Administrator sein, um dieses Kommando zu verwenden.").set_flags(dpp::message_flags::m_ephemeral));
|
||||
return;
|
||||
}
|
||||
// Continue in new thread...
|
||||
std::thread([this, event] () {
|
||||
// Construct lua execution
|
||||
|
|
Loading…
Add table
Reference in a new issue