I was trying to make a slash command for my bot but the commands only appear when I create them in the main file. In the cog files they seem to be ignored.
import discord.commands
from Package.base import *
class Testing(commands.Cog):
def __init__(self, bot):
self.bot = bot
# copied from https://guide.pycord.dev/popular-topics/cogs | 'name' and 'guild_ids' has been added
@discord.slash_command(name="goodbye", guild_ids=[1057048135106572319]) # we can also add application commands
async def goodbye(self, ctx):
await ctx.respond('Goodbye!')
def setup(bot):
bot.add_cog(Testing(bot))