mcbot/cmds/xmpp.lua
author Mikael Berthe <mikael@lilotux.net>
Sat, 17 Apr 2010 15:24:18 +0200
changeset 25 788c62c29e18
child 51 a3e9f8f9d969
permissions -rw-r--r--
Add a simple xmpp command


-- 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)