xbot/scripts/hello.lua

23 lines
470 B
Lua
Raw Normal View History

2024-02-25 17:09:24 +00:00
NAME = "hello"
VERSION = "v0.5"
AUTHOR = "Aaron Blakely"
DESCRIPTION = "A simple hello world script for xbot"
2024-02-27 07:16:58 +00:00
local handlers = {}
2024-02-25 17:09:24 +00:00
function hi(nick, host, chan, text)
privmsg(chan, "Hello, " .. nick .. "!")
2024-02-25 17:09:24 +00:00
end
function load()
-- register_script(NAME, VERSION, AUTHOR, DESCRIPTION)
2024-02-27 07:16:58 +00:00
table.insert(handlers, {PRIVMSG_CHAN, add_handler(PRIVMSG_CHAN, hi)})
2024-02-25 17:09:24 +00:00
end
function unload()
2024-02-27 07:16:58 +00:00
for i, v in ipairs(handlers) do
del_handler(v[1], v[2])
end
2024-02-25 17:09:24 +00:00
end