From 2ca9b42d1a352e7a3b1d933bf0f424ef9ab705d2 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 2 Jul 2025 03:33:15 +0500 Subject: upd: use feature_to_str in !set --- bot/src/commands/lua.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bot/src/commands/lua.cpp') diff --git a/bot/src/commands/lua.cpp b/bot/src/commands/lua.cpp index a8db207..2c1b176 100644 --- a/bot/src/commands/lua.cpp +++ b/bot/src/commands/lua.cpp @@ -401,6 +401,16 @@ namespace bot::command::lua { } }); + state->set_function("feature_to_str", [state](const int &feature) { + auto f = schemas::channelfeature_to_string( + static_cast(feature)); + if (f.has_value()) { + return sol::make_object(*state, *f); + } else { + return sol::make_object(*state, sol::lua_nil); + } + }); + state->set_function("event_type_to_str", [](const int &v) { return schemas::event_type_to_string(v); }); -- cgit v1.2.3