mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 10:51:05 -05:00
Added a command existence check using discord.utils.get()
Only register the command if it's not already present Maintained all other functionality including cog loading and task initialization
This commit is contained in:
@@ -11,7 +11,8 @@ async def setup(bot: Red) -> None:
|
|||||||
try:
|
try:
|
||||||
cog = Birthday(bot)
|
cog = Birthday(bot)
|
||||||
await bot.add_cog(cog)
|
await bot.add_cog(cog)
|
||||||
# Add context menu command
|
# Add context menu command if it doesn't exist
|
||||||
|
if not discord.utils.get(bot.tree.get_commands(), name="Give Birthday Role"):
|
||||||
bot.tree.add_command(birthday_context_menu)
|
bot.tree.add_command(birthday_context_menu)
|
||||||
# Initialize scheduled tasks
|
# Initialize scheduled tasks
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user