welcome/bye on join/leave group

function to alter msg before checking against plugin triggers
This commit is contained in:
dupie
2015-07-10 03:52:22 -04:00
parent 947d397673
commit 8c9a5ae7ba
4 changed files with 31 additions and 3 deletions

View File

@ -1,4 +1,4 @@
-- shout-out to @luksi_reiku for showing me this site
-- shout-out to @luksireiku for showing me this site
local PLUGIN = {}

View File

@ -32,6 +32,10 @@ function PLUGIN.action(msg) -- I WISH LUA HAD PROPER REGEX SUPPORT
return send_message(msg.chat.id, 'Hi, ' .. msg.from.first_name .. '!')
end
if input:match('bye,? '..bot.first_name) or input:match('later,? '..bot.first_name) then
return send_message(msg.chat.id, 'Bye-bye, ' .. msg.from.first_name .. '!')
end
if input:match('i hate you,? '..bot.first_name) or input:match('screw you,? '..bot.first_name) or input:match('fuck you,? '..bot.first_name) then
return send_msg(msg, '; _ ;')
end
@ -40,6 +44,9 @@ function PLUGIN.action(msg) -- I WISH LUA HAD PROPER REGEX SUPPORT
return send_msg(msg, '<3')
end
-- msg.text = '@' .. bot.username .. ', ' .. msg.text:gsub(bot.first_name, '')
-- on_msg_receive(msg)
end
return PLUGIN