summaryrefslogtreecommitdiff
path: root/bot/src
diff options
context:
space:
mode:
Diffstat (limited to 'bot/src')
-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);
});