mcbot/cmds/xep.lua
changeset 7 c515e8218c87
parent 5 a0b9529f17db
child 11 4993fc6b1108
equal deleted inserted replaced
6:7cf014d0d206 7:c515e8218c87
    31     parse_xeps(xepdata)
    31     parse_xeps(xepdata)
    32 end
    32 end
    33 
    33 
    34 -- Logics comes from MattJ's riddim bot
    34 -- Logics comes from MattJ's riddim bot
    35 local function lookup_xep (xepnum)
    35 local function lookup_xep (xepnum)
    36     xepnum = xepnum:gsub("[%s%?%.%!]+$", "")
    36     if (xepnum) then xepnum = xepnum:gsub("[%s%?%.%!]+$", "") end
    37     -- Check that xepnum is a valid number
    37     -- Check that xepnum is a valid number
    38     xepnum = tonumber(xepnum)
    38     xepnum = tonumber(xepnum)
    39     if not xepnum or xepnum <= 0 or xepnum > 9999 then return nil, "What XEP?" end
    39     if not xepnum or xepnum <= 0 or xepnum > 9999 then return nil, "What XEP?" end
    40     xepnum = tostring(xepnum)
    40     xepnum = tostring(xepnum)
    41     -- Download XEP list
    41     -- Download XEP list