merge upstream
LoWeR cAsE Show red error if loading plugin fails
This commit is contained in:
@ -430,12 +430,17 @@ function send_large_msg_callback(cb_extra, success, result)
|
||||
end
|
||||
|
||||
-- Returns a table with matches or nil
|
||||
function match_pattern(pattern, text)
|
||||
function match_pattern(pattern, text, lower_case)
|
||||
if text then
|
||||
local matches = { string.match(text, pattern) }
|
||||
if next(matches) then
|
||||
return matches
|
||||
end
|
||||
local matches = {}
|
||||
if lower_case then
|
||||
matches = { string.match(text:lower(), pattern) }
|
||||
else
|
||||
matches = { string.match(text, pattern) }
|
||||
end
|
||||
if next(matches) then
|
||||
return matches
|
||||
end
|
||||
end
|
||||
-- nil
|
||||
end
|
||||
|
Reference in New Issue
Block a user