diff options
| author | ilotterytea <iltsu@alright.party> | 2024-05-01 14:02:23 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-05-01 14:02:23 +0500 |
| commit | 0d22ee8a01e2822ed89480b0620ee082c223f0dd (patch) | |
| tree | 8b2ce304d24eff1949048b5061c84d7a380b45c5 /src | |
| parent | 480125dad7fef61eefc7b381f42d547055224990 (diff) | |
feat: don't run cmd if user has lower permission level than required
Diffstat (limited to 'src')
| -rw-r--r-- | src/commands/command.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/commands/command.cpp b/src/commands/command.cpp index bf482f5..a5ead40 100644 --- a/src/commands/command.cpp +++ b/src/commands/command.cpp @@ -29,6 +29,11 @@ namespace bot { return std::nullopt; } + if ((*command)->get_permission_level() > + request.user_rights.get_level()) { + return std::nullopt; + } + return (*command)->run(bundle, request); } } |
