#vague error message

1 messages · Page 1 of 1 (latest)

sleek ravine
#

Anyone know why I’m getting this error? I’m can’t seem to find why..

Ignoring exception in on_connect
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/client.py", line 377, in _run_event
    await coro(*args, **kwargs)
  File "/home/container/.local/lib/python3.9/site-packages/discord/bot.py", line 1138, in on_connect
    await self.sync_commands()
  File "/home/container/.local/lib/python3.9/site-packages/discord/bot.py", line 692, in sync_commands
    registered_commands = await self.register_commands(
  File "/home/container/.local/lib/python3.9/site-packages/discord/bot.py", line 570, in register_commands
    data = [cmd["command"].to_dict() for cmd in filtered_deleted]
  File "/home/container/.local/lib/python3.9/site-packages/discord/bot.py", line 570, in <listcomp>
    data = [cmd["command"].to_dict() for cmd in filtered_deleted]
  File "/home/container/.local/lib/python3.9/site-packages/discord/commands/core.py", line 841, in to_dict
    "options": [o.to_dict() for o in self.options],
  File "/home/container/.local/lib/python3.9/site-packages/discord/commands/core.py", line 841, in <listcomp>
    "options": [o.to_dict() for o in self.options],
  File "/home/container/.local/lib/python3.9/site-packages/discord/commands/options.py", line 315, in to_dict
    "type": self.input_type.value,
AttributeError: 'NoneType' object has no attribute 'value'
#
@bot.slash_command(description = "View Aziel's current commands.")
async def help(self, ctx: discord.ApplicationContext):
    if not ctx.author.id == 831118106876969021:
        return await ctx.respond("This command is under maintenance.", ephemeral = True)
    pages = [
        discord.Embed(title = "test page 1"),
        discord.Embed(title = "test page 2")
    ]
    await ctx.respond(embeds = pages[0] if isinstance(pages[0], list) else [pages[0]], view = ButtonMenu(pages, 10, ctx.author))
#

here’s the relevant code

vocal saffron
#

Cuz the error says you haven't specified an option input type for some Slash cmd

unique wharf
#

The error isn’t vague, you just have to read and understand it oldsmiley

sleek ravine
#

so I believe it’s this command causing it

#

the error is shown on startup

vocal saffron
#

i just understood

#

you are using @bot.slash_command

#

which means this command is in the main file and not a cog

#

and cmds in the main file dont accept a self parameter

#

the ones in a cog do

#

but you would use @discord.slash_command then

sleek ravine
#

tysm!

unique wharf
tight moatBOT
# sleek ravine tysm!

Done with your help thread?

Please close your own help thread by using </close:882631512829329448> with @primal cairn.

sleek ravine
primal cairnBOT
#

This thread was archived by a staff member.