log: Try to find error of not sending reminder
All checks were successful
Build Docker / Build Docker (push) Successful in 17s
All checks were successful
Build Docker / Build Docker (push) Successful in 17s
This commit is contained in:
3
bot.py
3
bot.py
@@ -469,6 +469,7 @@ async def remindme(ctx, when: str, reminder: str):
|
||||
await ctx.response.send_message("Invalid time format. Please use something like `1d 3h` or `4hr`.",ephemeral=True)
|
||||
|
||||
async def check_reminders():
|
||||
print("Checking reminders", flush=True)
|
||||
now = datetime.datetime.now()
|
||||
reminders = read_reminders()
|
||||
|
||||
@@ -477,8 +478,8 @@ async def check_reminders():
|
||||
if reminder_time <= now:
|
||||
user = await client.fetch_user(int(reminder['user_id']))
|
||||
await user.send("G'day,\nI need to remind you of:\n" + reminder['text'])
|
||||
print("Reminder sent", flush=True)
|
||||
reminders.remove(reminder)
|
||||
|
||||
write_reminders(reminders)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user