mcbot/cmds/xmpp.lua
changeset 25 788c62c29e18
child 51 a3e9f8f9d969
equal deleted inserted replaced
24:77a72b227d59 25:788c62c29e18
       
     1 
       
     2 -- Ugly module with hardcoded URLs to the XMPP draft URLs...
       
     3 
       
     4 local xmpp = { ["desc"] = "Give URLs to XMPP documents" }
       
     5 
       
     6 function xmpp.cmd (args)
       
     7     local xmppbaseurl = "http://datatracker.ietf.org/doc/"
       
     8     local urls = {}
       
     9 
       
    10     urls["3920"] = {
       
    11         ["desc"] = "Core",
       
    12         ["url"] = xmppbaseurl.."draft-ietf-xmpp-3920bis/",
       
    13     }
       
    14     urls["3921"] = {
       
    15         ["desc"] = "Instant Messaging and Presence",
       
    16         ["url"] = xmppbaseurl.."draft-ietf-xmpp-3921bis/",
       
    17     }
       
    18 
       
    19     local r = "XMPP is the eXtensible Messaging and Presence Protocol. See:\n"
       
    20     for k, urltable in pairs(urls) do
       
    21         r = r .. urltable.desc..": <"..urltable.url..">\n"
       
    22     end
       
    23     r = r:gsub("\n+$", "")
       
    24 
       
    25     return r
       
    26 end
       
    27 
       
    28 mcbot_register_command("xmpp", xmpp)