28 |
28 |
29 function handle_xep_command(command) |
29 function handle_xep_command(command) |
30 local xepnum = command.param; |
30 local xepnum = command.param; |
31 if not xepnum then return "Please supply an XEP number or a search string :)"; end |
31 if not xepnum then return "Please supply an XEP number or a search string :)"; end |
32 if not tonumber(xepnum) then -- Search for an XEP |
32 if not tonumber(xepnum) then -- Search for an XEP |
33 if xepnum:match("^%d+ ex") then |
33 if xepnum:match("^(%d+) ex%S* (%d+)$") then |
34 local num, example = xepnum:match("^(%d+) ex%S* (%d+)$"); |
34 local num, example = xepnum:match("^(%d+) ex%S* (%d+)$"); |
35 return "http://xmpp.org/extensions/xep-"..string.rep("0", 4-num:len())..num..".html#example-"..tostring(example); |
35 return "http://xmpp.org/extensions/xep-"..string.rep("0", 4-num:len())..num..".html#example-"..tostring(example); |
36 end |
36 end |
37 local results = {}; |
37 local results = {}; |
38 for x, xep in pairs(xeps) do |
38 for x, xep in pairs(xeps) do |