This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot-2/plugins/personality.lua
2015-07-02 18:15:52 -04:00

39 lines
1000 B
Lua

local PLUGIN = {}
PLUGIN.triggers = {
'otouto%p?$',
'^tadaima%p?$',
'^i\'m home%p?$',
'^i\'m back%p?$'
}
function PLUGIN.action(msg) -- I WISH LUA HAD PROPER REGEX SUPPORT
local input = string.lower(msg.text)
for i = 2, #PLUGIN.triggers do
if string.match(input, PLUGIN.triggers[i]) then
return send_message(msg.chat.id, 'Welcome back, ' .. msg.from.first_name .. '!')
end
end
if input:match('thanks,? otouto') or input:match('thank you,? otouto') then
return send_message(msg.chat.id, 'No problem, ' .. msg.from.first_name .. '!')
end
if input:match('hello,? otouto') or input:match('hey,? otouto') or input:match('hi,? otouto') then
return send_message(msg.chat.id, 'Hi, ' .. msg.from.first_name .. '!')
end
if input:match('i hate you,? otouto') or input:match('screw you,? otouto') or input:match('fuck you,? otouto') then
return send_msg(msg, '; _ ;')
end
if string.match(input, 'i love you,? otouto') then
return send_msg(msg, '<3')
end
end
return PLUGIN