Use datetime.now().date() instead of today().
build_latest / build (push) Successful in 1m53s
build_release / build (push) Successful in 17s

This commit is contained in:
2024-05-22 16:23:53 -04:00
parent ed06748984
commit 1fd1be5576
4 changed files with 16 additions and 17 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ Defines the daily loop that runs the Dakiny bot functions.
"""
import random
from datetime import datetime, time
from datetime import UTC, datetime, time
import nextcord
from nextcord.ext import commands, tasks
@@ -92,7 +92,7 @@ class DailyLoop(commands.Cog, name="Daily Loop"):
if random.randint(0, 99) == 0:
birthday_list.append(239547993106284544)
today = datetime.today()
today = datetime.now(tz=UTC).date()
birthday = f"{today.month}/{today.day}"
stmt = select(UserBirthday.UserId).where(UserBirthday.Birthday == birthday)
@@ -105,7 +105,7 @@ class DailyLoop(commands.Cog, name="Daily Loop"):
Loops through the guild's humans checking for joined_at dates that match today's date. Sends a message
saying happy cakeday.
"""
today = datetime.today()
today = datetime.now(tz=UTC).date()
guild: nextcord.Guild = self.bot.get_guild(self.bot.config.params.guild_id)
announce_channel: nextcord.TextChannel = guild.get_channel(self.bot.config.params.general_channel_id)