fix: typo in reminders count
All checks were successful
Build Docker / Build Docker (push) Successful in 17s

This commit is contained in:
Nathan Woodburn 2023-11-14 13:33:59 +11:00
parent 9db6c0e8b3
commit 65d7252f5f
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -28,10 +28,13 @@ def read_reminders():
reminders = [line.strip().split(',') for line in file.readlines()]
# Remove empty lines
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[1],
'text': r[2]
} for r in reminders]
except FileNotFoundError:
return []
@ -61,3 +64,6 @@ if __name__ == '__main__':
print(parse_time('1h'))
print(parse_time('1m 2s'))
print(parse_time('1m'))
print(read_reminders())
store_reminder(123, datetime.datetime.now(), 'test')
print(read_reminders())