mirror of
https://github.com/osmarks/autobotrobot
synced 2025-01-09 07:00:27 +00:00
fix readiness checks
This commit is contained in:
parent
f0f0726998
commit
7c5c62ff40
@ -24,7 +24,7 @@ def setup(bot):
|
||||
try:
|
||||
time = util.parse_time(time)
|
||||
except:
|
||||
await ctx.send(embed=util.error_embed("Invalid time"))
|
||||
await ctx.send(embed=util.error_embed("Invalid time (wrong format/too large/non-integer months or years)"))
|
||||
return
|
||||
await bot.database.execute("INSERT INTO reminders (remind_timestamp, created_timestamp, reminder, expired, extra) VALUES (?, ?, ?, ?, ?)",
|
||||
(time.timestamp(), util.timestamp(), reminder, 0, util.json_encode(extra_data)))
|
||||
@ -93,6 +93,12 @@ def setup(bot):
|
||||
await bot.database.execute("UPDATE reminders SET expired = 1 WHERE id = ?", (expiry_id,))
|
||||
await bot.database.commit()
|
||||
|
||||
@remind_worker.before_loop
|
||||
async def before_remind_worker():
|
||||
logging.info("Waiting for bot readiness...")
|
||||
await bot.wait_until_ready()
|
||||
logging.info("Remind worker starting")
|
||||
|
||||
remind_worker.start()
|
||||
bot.remind_worker = remind_worker
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user