mcbot/cmds/xep.lua
changeset 4 3e3767ada403
parent 3 508108deee63
child 5 a0b9529f17db
equal deleted inserted replaced
3:508108deee63 4:3e3767ada403
    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     -- Check that xepnum is a valid number
    37     -- Check that xepnum is a valid number
    37     xepnum = tonumber(xepnum)
    38     xepnum = tonumber(xepnum)
    38     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
    39     xepnum = tostring(xepnum)
    40     xepnum = tostring(xepnum)
    40     -- Download XEP list
    41     -- Download XEP list