mcbot/cmds/xep.lua
changeset 39 237af42156a1
parent 30 e5e20eed6c58
child 66 d9c00a9fe9d5
equal deleted inserted replaced
38:a51ddbce247b 39:237af42156a1
    27 local function fetch_xeps ()
    27 local function fetch_xeps ()
    28     local now = os.time()
    28     local now = os.time()
    29     if os.difftime(now, xeps_updated_at) < 43200 then return end
    29     if os.difftime(now, xeps_updated_at) < 43200 then return end
    30     -- Let's get some fresh data
    30     -- Let's get some fresh data
    31     local xepdata = shcmd(xeplisturl)
    31     local xepdata = shcmd(xeplisturl)
    32     xeps_updated_at = now
    32     if xepdata then
    33     parse_xeps(xepdata)
    33         xeps_updated_at = now
       
    34         parse_xeps(xepdata)
       
    35     end
    34 end
    36 end
    35 
    37 
    36 -- Deeply inspired by MattJ's riddim bot
    38 -- Deeply inspired by MattJ's riddim bot
    37 function xep.cmd (xepstr)
    39 function xep.cmd (xepstr)
    38     if (xepstr) then
    40     if (xepstr) then