welcome/bye on join/leave group
function to alter msg before checking against plugin triggers
This commit is contained in:
@ -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 = {}
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user