Fix bot routine scheduling field mismatch and add debug logging
Bot was sending days_of_week/times but API expects days/time, so bot-scheduled routines never got reminders. Also handle NULL frequency from pre-migration rows and add detailed logging to routine reminder checks for diagnosing further issues. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -217,12 +217,13 @@ async def handle_routine(message, session, parsed):
|
||||
await message.channel.send("When should this routine be scheduled? (e.g., 'Monday Wednesday Friday at 7am')")
|
||||
return
|
||||
|
||||
# Build schedule data
|
||||
# Build schedule data (API expects "days" and "time")
|
||||
schedule_data = {}
|
||||
if days_of_week:
|
||||
schedule_data["days_of_week"] = days_of_week
|
||||
schedule_data["days"] = days_of_week
|
||||
if times:
|
||||
schedule_data["times"] = times
|
||||
schedule_data["time"] = times[0]
|
||||
schedule_data["remind"] = True
|
||||
|
||||
resp, status = api_request("put", f"/api/routines/{routine_id}/schedule", token, schedule_data)
|
||||
if status == 200:
|
||||
|
||||
Reference in New Issue
Block a user