# HG changeset patch # User Mikael Berthe # Date 1271510658 -7200 # Node ID 788c62c29e1807ea55dc42f4497908608d44174a # Parent 77a72b227d59accc7aaebe442b7661e8ba753bc2 Add a simple xmpp command diff -r 77a72b227d59 -r 788c62c29e18 mcbot/cmds/xmpp.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mcbot/cmds/xmpp.lua Sat Apr 17 15:24:18 2010 +0200 @@ -0,0 +1,28 @@ + +-- Ugly module with hardcoded URLs to the XMPP draft URLs... + +local xmpp = { ["desc"] = "Give URLs to XMPP documents" } + +function xmpp.cmd (args) + local xmppbaseurl = "http://datatracker.ietf.org/doc/" + local urls = {} + + urls["3920"] = { + ["desc"] = "Core", + ["url"] = xmppbaseurl.."draft-ietf-xmpp-3920bis/", + } + urls["3921"] = { + ["desc"] = "Instant Messaging and Presence", + ["url"] = xmppbaseurl.."draft-ietf-xmpp-3921bis/", + } + + local r = "XMPP is the eXtensible Messaging and Presence Protocol. See:\n" + for k, urltable in pairs(urls) do + r = r .. urltable.desc..": <"..urltable.url..">\n" + end + r = r:gsub("\n+$", "") + + return r +end + +mcbot_register_command("xmpp", xmpp) diff -r 77a72b227d59 -r 788c62c29e18 mcbot/mcbot_engine.lua --- a/mcbot/mcbot_engine.lua Sat Apr 17 14:40:36 2010 +0200 +++ b/mcbot/mcbot_engine.lua Sat Apr 17 15:24:18 2010 +0200 @@ -30,6 +30,7 @@ require "cmds.xep" require "cmds.mcabber_bts" require "cmds.bofh" +require "cmds.xmpp" function process (line, botdata, muc) local n