diff --git a/.env.example b/.env.example index 5822380..87e6bbe 100644 --- a/.env.example +++ b/.env.example @@ -17,7 +17,7 @@ POKE_CHANNEL= POKE_ROLE= POKEBALL_EMOJI= # Birthdays notif -BIRTHDAY_CHANNEL= +BIRTHDAY_CHANNEL= # Hypixel API key HYPIXEL_KEY= diff --git a/commands/birthdays.py b/commands/birthdays.py index a4f494f..dd9f7b9 100644 --- a/commands/birthdays.py +++ b/commands/birthdays.py @@ -40,4 +40,6 @@ async def remove_birthday(interaction: discord.Interaction[ChouetteBot]): save_birthdays(birthdays) await interaction.response.send_message("Anniversaire supprimé !") else: - await interaction.response.send_message("Vous n'avez pas d'anniversaire enregistré.", ephemeral=True) + await interaction.response.send_message( + "Vous n'avez pas d'anniversaire enregistré.", ephemeral=True + ) diff --git a/requirements.txt b/requirements.txt index 06638d3..88340a0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ aiohttp ~= 3.9.3 discord.py[speed] ~= 2.3.2 python-dotenv ~= 1.0.1 -tomlkit ~= 0.12.4 \ No newline at end of file +tomlkit ~= 0.12.4 diff --git a/tasks.py b/tasks.py index c3ffa87..76c1c32 100644 --- a/tasks.py +++ b/tasks.py @@ -18,18 +18,20 @@ async def poke_ping(): pokeball = client.get_emoji(int(client.config["POKEBALL_EMOJI"])) msg_poke = f"{dresseurs.mention} C'est l'heure d'attraper des pokémons {pokeball}" await client.get_channel(int(client.config["POKE_CHANNEL"])).send(msg_poke) - + # Loop to check if it's 8:00 and send a message if it's someone's birthday @tasks.loop(hours=24) async def check_birthdays(): now = time.now() if now.hour == 8 and now.minute == 0: - today = now.strftime('%d/%m') + today = now.strftime("%d/%m") for user_id, birthday in birthdays.items(): if birthday == today: user = await bot.fetch_user(int(user_id)) msg_birthday = f":tada: {user.mention} is a year older now! Wish them a happy birthday! :tada:" - await client.get_channel(int(client.config["BIRTHDAY_CHANNEL"])).send(msg_birthday) + await client.get_channel(int(client.config["BIRTHDAY_CHANNEL"])).send( + msg_birthday + ) # Start loop poke_ping.start()