From cac2bbab2fc54357bf6f19b9a83510d0581514cf Mon Sep 17 00:00:00 2001 From: pacnpal Date: Sat, 28 Sep 2024 21:31:22 -0400 Subject: [PATCH] birthday fixes --- birthday/README.md | 7 +++---- birthday/birthday.py | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/birthday/README.md b/birthday/README.md index 8072132..9bcb647 100644 --- a/birthday/README.md +++ b/birthday/README.md @@ -44,6 +44,7 @@ Before using the cog, you need to set it up: ``` [p]birthdayset channel #birthdays ``` + If not set, the birthday message will be sent in the channel where the command is used. ## Usage @@ -60,7 +61,7 @@ This will assign the birthday role to the user and send a celebratory message wi - Sends a celebratory message with random cake (or pie) emojis - Automatically removes the birthday role at midnight - Configurable timezone for role expiration -- Option to set a specific channel for birthday announcements +- Option to set a specific channel for birthday announcements (defaults to the channel where the command is used) - Restricts usage of the birthday command to specified roles - Users can assign the birthday role without needing a role higher than it in the hierarchy @@ -75,6 +76,4 @@ This will assign the birthday role to the user and send a celebratory message wi ## Support -If you encounter any issues or have questions, please open an issue on the [GitHub repository](https://github.com/pacnpal/Pac-cogs). - -Enjoy celebrating birthdays with your Discord community! \ No newline at end of file +If you encounter any issues or have questions, please open an issue on the [GitHub repository](https://github.com/pacnpal/Pac-cogs). \ No newline at end of file diff --git a/birthday/birthday.py b/birthday/birthday.py index b14a273..5cc2459 100644 --- a/birthday/birthday.py +++ b/birthday/birthday.py @@ -95,6 +95,8 @@ class Birthday(commands.Cog): birthday_channel_id = await self.config.guild(ctx.guild).birthday_channel() if birthday_channel_id: channel = self.bot.get_channel(birthday_channel_id) + if not channel: # If the set channel doesn't exist anymore + channel = ctx.channel else: channel = ctx.channel