diff options
| author | ilotterytea <iltsu@alright.party> | 2025-04-08 01:06:11 +0400 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-04-08 01:06:11 +0400 |
| commit | fbf41a4c737174442717ade79e895321ee8ada36 (patch) | |
| tree | 43433eb33da9574d808c3a429cc45e5a73e57597 /bot/src/commands | |
| parent | f67badeab7089e85e53b20d6e20d41f641385aa8 (diff) | |
upd: add twitch lib on every command run (that's maybe bad for performance)
Diffstat (limited to 'bot/src/commands')
| -rw-r--r-- | bot/src/commands/command.cpp | 4 | ||||
| -rw-r--r-- | bot/src/commands/command.hpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/bot/src/commands/command.cpp b/bot/src/commands/command.cpp index 1658554..87eecfd 100644 --- a/bot/src/commands/command.cpp +++ b/bot/src/commands/command.cpp @@ -84,7 +84,9 @@ namespace bot { } std::optional<Response> CommandLoader::run(const InstanceBundle &bundle, - const Request &request) const { + const Request &request) { + lua::library::add_twitch_library(this->luaState, request, bundle); + auto command = std::find_if( this->commands.begin(), this->commands.end(), [&](const auto &x) { return x->get_name() == request.command_id; }); diff --git a/bot/src/commands/command.hpp b/bot/src/commands/command.hpp index c2398ec..fcaacdb 100644 --- a/bot/src/commands/command.hpp +++ b/bot/src/commands/command.hpp @@ -45,7 +45,7 @@ namespace bot { void add_command(std::unique_ptr<Command> cmd); void load_lua_directory(const std::string &folder_path); std::optional<Response> run(const InstanceBundle &bundle, - const Request &msg) const; + const Request &msg); const std::vector<std::unique_ptr<Command>> &get_commands() const { return this->commands; |
