#Issue with loading Cogs

1 messages · Page 1 of 1 (latest)

granite sphinx
#

Can someone help me with this error? I've tried looking online but I can't find a fix for it.

Code

class Dev(commands.Cog):

    dev = discord.SlashCommandGroup(name="dev", description="Dev")

    def __init__(self, bot):
        self.bot = bot

    @dev.command(description="Can be used to load commands")
    async def load_command(self, ctx, command):
        for filename in os.listdir("./cogs"):
            try:
                self.bot.load_extension(f"cogs.{command}")
                embed = discord.Embed(title = "Command Loaded", description="You have succesfully loaded the command", color = discord.Color.blue()) 
                await ctx.respond(embed=embed)
                print(f"[✅] {command} loaded ")
                return
            except discord.errors.ExtensionAlreadyLoaded:
                embed = discord.Embed(title = "Command Already Loaded", description="This command is already loaded.", color = discord.Color.dark_orange()) 
                await ctx.respond(embed=embed)
                print(f"[✅] {command} already loaded ")
                return
        print(f"[🔧] {ctx.author} ({ctx.author.id}) used /dev load_command")

Error

discord.errors.ClientException: Callback for remove command is missing "context" parameter.
#

I’m not sure where I went wrong since the command option seems to show up on the command.

heavy hazel
#

are you sure its from this cog?

granite sphinx
heavy hazel
#

also where do you remove the .py?

granite sphinx
#

But I feel like it’s mainly an issue with the slash command I think

#

Since that’s what the error is saying

#

Mainly with the command argument

#

But idk how to fix it

obtuse dirge
granite sphinx
#

I’ll do this tmrw when I’m on my computer, sorry completely forgot 💀

granite sphinx
regal flareBOT
obtuse dirge
#

It looks like in your roblox cog you have a command called remove. When making commands it should look like this.

async def remove(ctx, arg1, arg2...):

It looks like you for got the ctx.

granite sphinx
#

and I have ctx there as well

#
async def load_command(self, ctx, command):
granite sphinx
#

I checked my code

#

I do

#

Let me fix that

#

ty for your help!