#AttributeError: '_MissingSentinel' object has no attribute '_get_overridden_method'

1 messages · Page 1 of 1 (latest)

primal spoke
#

Hi,
I have made many bots with Pycord before and have always encountered this same error when trying to create a sub-command group. (This time, I am making a MADFUT bot.) I expected a command like /mf admin pay user:something blablabla, but what came out in Discord was a command (/mf admin pay) without any arguments although I clearly set arguments in the command. Also, when I try running the command, it gives me the error mentioned in the title: AttributeError: '_MissingSentinel' object has no attribute '_get_overridden_method'. Here are some images of the command and the error, and a snippet of my code:

@adminCommands.command(name="pay", description="[ADMIN ONLY] Pay a user. Your wallet will not be affected.")
@commands.has_role(int(config["botPermsRole"]))
async def mf_admin_pay(ctx: discord.ApplicationContext, user:discord.Option(discord.Member, "The user you want to pay."), coins:discord.Option(int, "The amount of coins you want to pay.", default=0), bottrades:discord.Option(int, "The amount of bottrades you want to pay.", default=0), cards:discord.Option(str, "A comma-seperated list of cards you want to pay.", default=""), packs:discord.Option(str, "A comma-seperated list of packs you want to pay.", default="")):
    # ... i excluded an unimportant snippet.
    await ctx.response.send_message(
        embed = discord.Embed(
            title = f"Your admin payment was sent to {user.name}",
            description = "✅ Your admin payment was successful ✅",
            color = EMBED_PRIMARY,
            timestamp = datetime.datetime.now()
        )
    )
bleak dew
primal spoke
#

Yes, thank you!

bleak dew
#

yeah it is a known bug

#

||hopefully someone will work on it soon||

primal spoke
#

Yep, i hope so too

gusty meadow
#

This is why I don't use typehints for options pain

bleak dew
#

is that the reason? 🤔

#

Although yes i always use the decorator

#

lul

gusty meadow
olive nest
#

while there's a separate issue here with options, the traceback is a slightly different issue with cog checks

#

when a subgroup's made without cogs, this check fails to account for MISSING (a few times in the file)```py
if cog is not None:
local_check = cog._get_overridden_method(cog.cog_check)
if local_check is not None:
...

#

the option disappearing issue also doesn't happen in cogs, the different structures are too strange

#

(basically the current solution is to switch to cogs, but this should be looked into properly)

primal spoke
#

Sorry for the late response, but thank you! I will try that