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/otouto/plugins/ping.lua

17 lines
440 B
Lua
Raw Normal View History

-- Actually the simplest plugin ever!
local ping = {}
2016-06-07 06:31:34 +02:00
local utilities = require('otouto.utilities')
function ping:init(config)
2016-08-14 04:46:18 +02:00
ping.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('ping'):t('annyong').table
end
function ping:action(msg, config)
2016-08-14 04:46:18 +02:00
local output = msg.text_lower:match('^'..config.cmd_pat..'ping') and 'Pong!' or 'Annyong.'
utilities.send_message(self, msg.chat.id, output)
end
return ping