diff options
| author | ilotterytea <iltsu@alright.party> | 2025-04-12 16:54:58 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-04-12 16:54:58 +0500 |
| commit | 0e1b8bcdd6435ea1f1ad878a6f0813ab72259c24 (patch) | |
| tree | 103f5c25f284b2eaa002e2014b77cb2828f6da0a /bot/src/commands/lua.cpp | |
| parent | cd745390a89194fb7ae430f3bc8a73a7fc315ef0 (diff) | |
feat: irc functions for lua
Diffstat (limited to 'bot/src/commands/lua.cpp')
| -rw-r--r-- | bot/src/commands/lua.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bot/src/commands/lua.cpp b/bot/src/commands/lua.cpp index 96a9a68..1140334 100644 --- a/bot/src/commands/lua.cpp +++ b/bot/src/commands/lua.cpp @@ -362,6 +362,20 @@ namespace bot::command::lua { add_l10n_library(state); } + void add_irc_library(std::shared_ptr<sol::state> state, + const InstanceBundle &bundle) { + state->set_function("irc_join_channel", + [&bundle](const std::string &channel_name) { + return bundle.irc_client.join(channel_name); + }); + + state->set_function("irc_send_message", + [&bundle](const std::string &channel_name, + const std::string &message) { + bundle.irc_client.say(channel_name, message); + }); + } + void add_twitch_library(std::shared_ptr<sol::state> state, const Request &request, const InstanceBundle &bundle) { |
