# HG changeset patch # User Mikael Berthe # Date 1271629865 -7200 # Node ID 9d7f19e4e4fe7207068e855b3fafd9989cfedd09 # Parent 2aedd0749666e57166d2be829af06fa07a4e0d17 Add support for tvcal +n diff -r 2aedd0749666 -r 9d7f19e4e4fe mcbot/cmds/tvcal.lua --- a/mcbot/cmds/tvcal.lua Sun Apr 18 23:51:22 2010 +0200 +++ b/mcbot/cmds/tvcal.lua Mon Apr 19 00:31:05 2010 +0200 @@ -60,7 +60,7 @@ local function tvcal_by_date (d) if not tvcaldata[d] then - return "No episode found for this date" + return "No episode found for this date ("..d..")" end local r = "Shows on " .. d .. ":\n" @@ -106,6 +106,11 @@ arg = os.date("%F") elseif arg == "tomorrow" then arg = os.date("%F", os.date("%s")+86400) + elseif arg:match("^%+%d+$") then + local n = tonumber(arg:match("^%+(%d+)$")) + if n < 60 then + arg = os.date("%F", os.date("%s")+86400*n) + end end if arg:match("^%d%d%d%d%-%d%d%-%d%d$") then