diff options
| author | ilotterytea <iltsu@alright.party> | 2025-07-02 03:33:15 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-07-02 03:33:15 +0500 |
| commit | 2ca9b42d1a352e7a3b1d933bf0f424ef9ab705d2 (patch) | |
| tree | e11869ab6b349d8791bb02227f6b7a98b1b16758 /bot | |
| parent | 94fede466d8d77f53e5c49215fc8ad99a30610f9 (diff) | |
upd: use feature_to_str in !set
Diffstat (limited to 'bot')
| -rw-r--r-- | bot/src/commands/lua.cpp | 10 |
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); }); |
