*Should* have a working local refactor now.

This commit is contained in:
Brayden Banks
2016-04-10 21:04:47 -07:00
parent acb679f8fa
commit 24deaec759
49 changed files with 1026 additions and 952 deletions

View File

@ -1,11 +1,15 @@
-- Shout-out to Kenny, as I didn't want to write this until
-- he upset himself over the very thought of me doing so.
local triggers = {
local patterns = {}
local bindings = require('bindings')
patterns.triggers = {
'^/?s/.-/.-/?$'
}
local action = function(msg)
function patterns:action(msg)
if not msg.reply_to_message then return end
local output = msg.reply_to_message.text or ''
@ -13,11 +17,8 @@ local action = function(msg)
if not m2 then return true end
output = output:gsub(m1, m2)
output = 'Did you mean:\n"' .. output:sub(1, 4000) .. '"'
sendReply(msg.reply_to_message, output)
bindings.sendReply(self, msg.reply_to_message, output)
end
return {
triggers = triggers,
action = action
}
return patterns