*Should* have a working local refactor now.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user