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/example-plugin.lua
topkecleon 60570e90f3 added cron jobs for plugins
added example plugin with documentation
added liberbot-compliant flood control
	see Liberbot Support for details on getting compliant
added Kickass Torrent plugin
various bugfixes
all files seem to have been marked changed due to a shift in platform
	I will do a clean clone and testing to ensure there is no issue.
2015-08-28 23:15:01 -07:00

48 lines
1.1 KiB
Lua
Executable File

local doc = [[
/example <required> [optional]
Info about the plugin goes here.
]]
local triggers = {
'^/example',
'^/e '
}
local action = function(msg) do
-- do stuff
end
local cron = function() do
-- do stuff
end
return {
doc = doc,
triggers = triggers,
action = action,
cron = cron,
typing = true
}
--[[
Here's an example plugin.
"doc" is a string. It contains info on the plugin's usage.
The first line should be only the command and its expected arguments. Arguments should be encased in <> if they are required, and [] if they are optional.
The entire thing is sent as a message when "/help example" is used.
"triggers" is a table of triggers. A trigger is a string that should pattern-match the desired input.
"action" is the main function. It's what the plugin does. It takes a single argument, msg, which is a table of the contents of a message.
"cron" is another function. It is run every five seconds without regard to triggers or messages.
"typing" is a boolean. Set it to true if you want the bot to send a typing notification when the plugin is triggered.
]]--