Update misc.py
This commit is contained in:
1 parent
f011ae73c5
commit
ae5cdd5bed
1 file changed
+5
-5
+5
-5
@@ -111,11 +111,11 @@ class Misc(commands.Cog):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def seconds_until_target(self, hour: int, minute: int = 0):
|
def seconds_until_target(self, hour: int, minute: int = 0):
|
||||||
now = datetime.datetime.utcnow()
|
now = datetime.datetime.utcnow()
|
||||||
target = now.replace(hour=hour, minute=minute, second=0, microsecond=0)
|
target = now.replace(hour=hour, minute=minute, second=0, microsecond=0)
|
||||||
if target < now:
|
if target < now:
|
||||||
target += datetime.timedelta(days=1)
|
target += datetime.timedelta(days=1)
|
||||||
return (target - now).total_seconds()
|
return (target - now).total_seconds()
|
||||||
|
|
||||||
@tasks.loop(hours=24)
|
@tasks.loop(hours=24)
|
||||||
async def send_daily_message(self):
|
async def send_daily_message(self):
|
||||||
|
|||||||
Reference in new issue
Block a user