diff options
| author | ilotterytea <iltsu@alright.party> | 2025-07-03 18:05:11 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-07-03 18:05:47 +0500 |
| commit | e23ccfb00c8fa39926b32e94be6bc379e70ba11d (patch) | |
| tree | ad4758e8a1b947782186f11f1739dde1aca9ca23 /bot/src/commands/command.cpp | |
| parent | 1e8f182b083679b06d8e30fe52b1ed1130a19287 (diff) | |
feat: separated requester from request
Diffstat (limited to 'bot/src/commands/command.cpp')
| -rw-r--r-- | bot/src/commands/command.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bot/src/commands/command.cpp b/bot/src/commands/command.cpp index 533376a..2d34212 100644 --- a/bot/src/commands/command.cpp +++ b/bot/src/commands/command.cpp @@ -81,7 +81,7 @@ namespace bot { } if ((*command)->get_permission_level() > - request.user_rights.get_level()) { + request.requester.user_rights.get_level()) { return std::nullopt; } @@ -91,8 +91,9 @@ namespace bot { db::DatabaseRows actions = conn->exec( "SELECT sent_at FROM actions WHERE user_id = $1 AND channel_id = $2 " "AND command = $3 ORDER BY sent_at DESC", - {std::to_string(request.user.get_id()), - std::to_string(request.channel.get_id()), request.command_id}); + {std::to_string(request.requester.user.get_id()), + std::to_string(request.requester.channel.get_id()), + request.command_id}); if (!actions.empty()) { auto last_sent_at = @@ -124,9 +125,9 @@ namespace bot { conn->exec( "INSERT INTO actions(user_id, channel_id, command, arguments, " "full_message) VALUES ($1, $2, $3, $4, $5)", - {std::to_string(request.user.get_id()), - std::to_string(request.channel.get_id()), request.command_id, - arguments, request.irc_message.message}); + {std::to_string(request.requester.user.get_id()), + std::to_string(request.requester.channel.get_id()), + request.command_id, arguments, request.irc_message.message}); return (*command)->run(bundle, request); } |
