fix: Ignore empty reminders
All checks were successful
Build Docker / Build Docker (push) Successful in 16s
All checks were successful
Build Docker / Build Docker (push) Successful in 16s
This commit is contained in:
parent
e0fd085aab
commit
b6741bbfcf
@ -26,6 +26,8 @@ def read_reminders():
|
||||
try:
|
||||
with open(REMINDERS_FILE_PATH, 'r') as file:
|
||||
reminders = [line.strip().split(',') for line in file.readlines()]
|
||||
# Remove empty lines
|
||||
reminders = [r for r in reminders if len(r) == 3]
|
||||
return [{'user_id': r[0], 'time': r[2], 'text': r[3]} for r in reminders]
|
||||
except FileNotFoundError:
|
||||
return []
|
||||
|
Loading…
Reference in New Issue
Block a user