-- "Настрой утренний брифинг на 9:00" → adds a daily scheduled task that runs now.lua local phrase = (jarvis.context.phrase or ""):lower() -- try to extract HH:MM, default 9:00 local h, m = phrase:match("(%d%d?)[:%s%-](%d%d)") if not h then h = phrase:match("(%d%d?)") end local hh = tonumber(h) or 9 local mm = tonumber(m) or 0 if hh < 0 or hh > 23 or mm < 0 or mm > 59 then hh = 9; mm = 0 end local script_path = jarvis.context.command_path .. "/now.lua" script_path = script_path:gsub("/", "\\") local id = "daily_briefing_main" local ok, err = pcall(function() -- replace any prior briefing jarvis.scheduler.remove(id) jarvis.scheduler.add({ id = id, name = "Daily briefing", schedule = string.format("daily %02d:%02d", hh, mm), action = { type = "lua", script_path = script_path }, }) end) if not ok then jarvis.log("warn", "daily_briefing.setup: " .. tostring(err)) jarvis.speak("Не получилось настроить брифинг.") jarvis.audio.play_error() return { chain = false } end jarvis.speak(string.format("Утренний брифинг настроен на %02d:%02d.", hh, mm)) jarvis.audio.play_ok() return { chain = false }