diff options
| author | ilotterytea <iltsu@alright.party> | 2025-12-01 20:51:32 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-12-01 20:51:32 +0500 |
| commit | 638622d66dbe58ff96b7d1c2c6ec4b040b27da6d (patch) | |
| tree | 2f04c3b26a320f4abf5927edc5af34716e42b970 /bot/src/config.cpp | |
| parent | 0d36a1ee88fb7aedf5b33af7ac95140b002c5a64 (diff) | |
feat: switch for lua scripts
Diffstat (limited to 'bot/src/config.cpp')
| -rw-r--r-- | bot/src/config.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bot/src/config.cpp b/bot/src/config.cpp index 6cd8cf1..ccb042a 100644 --- a/bot/src/config.cpp +++ b/bot/src/config.cpp @@ -7,6 +7,7 @@ #include <string> #include "logger.hpp" +#include "utils/string.hpp" namespace bot { sol::table Configuration::as_lua_table( @@ -98,6 +99,7 @@ namespace bot { UrlConfiguration url_cfg; TokenConfiguration token_cfg; RssConfiguration rss_cfg; + LuaConfiguration lua_cfg; std::string line; while (std::getline(ifs, line, '\n')) { @@ -168,6 +170,12 @@ namespace bot { rss_cfg.bridge = value; } + else if (key == "lua.allow_arbitrary_scripts") { + lua_cfg.allow_arbitrary_scripts = std::stoi(value); + } else if (key == "lua.script_whitelist") { + lua_cfg.script_whitelist = utils::string::split_text(value, ','); + } + else if (key == "token.github") { token_cfg.github_token = value; } @@ -181,6 +189,7 @@ namespace bot { cfg.database = db_cfg; cfg.tokens = token_cfg; cfg.rss = rss_cfg; + cfg.lua = lua_cfg; log::info("Configuration", "Successfully loaded the file from '" + file_path + "'"); |
