mcbot/cmds/misc.lua
changeset 20 d6c602aaa231
parent 16 064a50911e05
child 21 bc5d611e6d6f
--- a/mcbot/cmds/misc.lua	Thu Apr 15 20:22:36 2010 +0200
+++ b/mcbot/cmds/misc.lua	Thu Apr 15 20:28:34 2010 +0200
@@ -1,10 +1,10 @@
 
 local hello = { ["hidden"] = true,
+                ["aliases"] = { "hi" },
                 ["cmd"] = function (args) return "Hello!" end
               }
 
 mcbot_register_command("hello", hello)
-mcbot_register_command("hi", hello)
 
 
 local thanks = { ["hidden"] = true,
@@ -14,7 +14,12 @@
 mcbot_register_command("thanks", thanks)
 
 
-local ping = { ["cmd"] = function (args) return "pong" end }
+local ping = {}
+ping.aliases = { "ding" }
+ping.cmd = function (args, botdata, cmd)
+    if cmd:lower() == "ding" then return "dong" end
+    return "pong"
+end
 
 mcbot_register_command("ping", ping)