moved match_pattern to utils
This commit is contained in:
parent
91aac0c138
commit
267f90d674
@ -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
|
||||
|
@ -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
|
Reference in New Issue
Block a user