diff --git a/bot/bot.lua b/bot/bot.lua index f417eea..0516c2b 100644 --- a/bot/bot.lua +++ b/bot/bot.lua @@ -63,15 +63,6 @@ function match_plugins(msg) end end --- Returns a table with matches or nil -function match_pattern(pattern, text) - local matches = { string.match(text, pattern) } - if next(matches) then - return matches - end - -- nil -end - -- Check if plugin is on _config.disabled_plugin_on_chat table local function is_plugin_disabled_on_chat(plugin_name, receiver) local disabled_chats = _config.disabled_plugin_on_chat diff --git a/bot/utils.lua b/bot/utils.lua index bc5df12..659ef6a 100644 --- a/bot/utils.lua +++ b/bot/utils.lua @@ -438,3 +438,12 @@ function send_large_msg_callback(cb_extra, success, result) send_msg(destination, my_text, send_large_msg_callback, cb_extra) end end + +-- Returns a table with matches or nil +function match_pattern(pattern, text) + local matches = { string.match(text, pattern) } + if next(matches) then + return matches + end + -- nil +end \ No newline at end of file