enhanced schedule

This commit is contained in:
Robert Altner 2020-01-11 20:01:14 +01:00
parent 8a4ef6947a
commit 6cfa3c5210

View file

@ -4,6 +4,7 @@ import asyncio
from discord.ext import commands
from datetime import datetime, timedelta
from random import randrange
from util import logging
def ceil_dt(dt, delta):
return dt + (datetime.min - dt) % delta
@ -40,6 +41,9 @@ class Schedule(commands.Cog):
seconds = (date - datetime.now()).seconds
await self.call_event(seconds, ' '.join(name), ctx.message.author, ctx.message.channel)
self.threads += 1
logging.info(f"Scheduled new event in {seconds} seconds. Current events: {self.therads}")
else:
logging.warning("Schedule: Event limit reached. Async function was not called.")