log: Try to find error in reading reminders
All checks were successful
Build Docker / Build Docker (push) Successful in 16s

This commit is contained in:
Nathan Woodburn 2023-11-14 13:29:27 +11:00
parent b6741bbfcf
commit 9db6c0e8b3
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -28,6 +28,9 @@ def read_reminders():
reminders = [line.strip().split(',') for line in file.readlines()] reminders = [line.strip().split(',') for line in file.readlines()]
# Remove empty lines # Remove empty lines
reminders = [r for r in reminders if len(r) == 3] reminders = [r for r in reminders if len(r) == 3]
print(reminders,flush=True)
if len(reminders) == 0:
return []
return [{'user_id': r[0], 'time': r[2], 'text': r[3]} for r in reminders] return [{'user_id': r[0], 'time': r[2], 'text': r[3]} for r in reminders]
except FileNotFoundError: except FileNotFoundError:
return [] return []