Better documentation
This commit is contained in:
parent
f6819de572
commit
ee87c6cb40
1 changed files with 8 additions and 3 deletions
|
@ -12,13 +12,18 @@ if TYPE_CHECKING:
|
|||
|
||||
|
||||
async def remind(self, bot: "Snake") -> None:
|
||||
"""Run reminders in the background."""
|
||||
"""
|
||||
Run reminders in the background.
|
||||
|
||||
Args:
|
||||
bot: Snake instance
|
||||
"""
|
||||
while True:
|
||||
await asyncio.sleep(5)
|
||||
reminders = await Reminder.find(
|
||||
reminders = Reminder.find(
|
||||
q(remind_at__lte=datetime.utcnow() + timedelta(seconds=5), active=True)
|
||||
)
|
||||
for reminder in reminders:
|
||||
async for reminder in reminders:
|
||||
user = await self._bot.fetch_user(reminder.user)
|
||||
if not user:
|
||||
await reminder.delete()
|
||||
|
|
Loading…
Add table
Reference in a new issue