mcbot/cmds/xep.lua
changeset 5 a0b9529f17db
parent 4 3e3767ada403
child 7 c515e8218c87
equal deleted inserted replaced
4:3e3767ada403 5:a0b9529f17db
    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%?%.%!]+$", ""):upper()
    36     xepnum = xepnum:gsub("[%s%?%.%!]+$", "")
    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