From 22f27c37844eeb814f304dc18597f3308ef7a441 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Fri, 11 Apr 2025 01:15:09 +0500 Subject: feat: str_split lua function --- bot/src/commands/lua.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bot/src/commands/lua.cpp b/bot/src/commands/lua.cpp index 2910fdf..75261ec 100644 --- a/bot/src/commands/lua.cpp +++ b/bot/src/commands/lua.cpp @@ -337,11 +337,19 @@ namespace bot::command::lua { }); } + void add_string_library(std::shared_ptr state) { + state->set_function("str_split", + [](const std::string &text, const char &delimiter) { + return utils::string::split_text(text, delimiter); + }); + } + void add_base_libraries(std::shared_ptr state) { add_bot_library(state); add_time_library(state); add_json_library(state); add_net_library(state); + add_string_library(state); add_l10n_library(state); } -- cgit v1.2.3