summaryrefslogtreecommitdiff
path: root/bot/src/commands
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-07-02 03:33:15 +0500
committerilotterytea <iltsu@alright.party>2025-07-02 03:33:15 +0500
commit2ca9b42d1a352e7a3b1d933bf0f424ef9ab705d2 (patch)
treee11869ab6b349d8791bb02227f6b7a98b1b16758 /bot/src/commands
parent94fede466d8d77f53e5c49215fc8ad99a30610f9 (diff)
upd: use feature_to_str in !set
Diffstat (limited to 'bot/src/commands')
-rw-r--r--bot/src/commands/lua.cpp10
1 files changed, 10 insertions, 0 deletions
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<schemas::ChannelFeature>(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);
});