mcbot/cmds/misc.lua
author Mikael Berthe <mikael@lilotux.net>
Wed, 21 Oct 2015 19:10:04 +0200
changeset 73 2ca07b5226c1
parent 33 50aa4b0d63c1
permissions -rw-r--r--
Update wtfdb


local hello = { ["hidden"] = true,
                ["aliases"] = { "hi" },
                ["cmd"] = function (args) return "Hello!" end
              }

mcbot_register_command("hello", hello)


local thanks = { ["hidden"] = true,
                 ["aliases"] = { "thx", "thank" },
               }
function thanks.cmd (args, botdata, cmd)
    return "You're welcome"
end

mcbot_register_command("thanks", thanks)


local ping = {}
ping.aliases = { "ding" }
function ping.cmd (args, botdata, cmd)
    if cmd:lower() == "ding" then return "dong" end
    return "pong"
end

mcbot_register_command("ping", ping)


local date = { ["desc"] = "Display the current date" }
function date.cmd (args)
    if args then
        return os.date(args)
    else
        return os.date()
    end
end

mcbot_register_command("date", date)