Pycord-Development / pycord

Pycord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python
https://docs.pycord.dev
MIT License
2.71k stars 459 forks source link

walk_application_commands() return None if 1 command is not loaded #2479

Open Lumabots opened 2 months ago

Lumabots commented 2 months ago

Summary

walk_application_commands() return None if 1 command is not loaded

Reproduction Steps

Create a command that cant be added, and check the walk_application_commands()

Minimal Reproducible Code

@commands.slash_command()
    async def ping(self, ctx: LumabotContext, test: str = None):
        await ctx.respond(ctx.translator.bot.test.success.format(test=test))

    @commands.slash_command()
    async def ping(self, ctx: LumabotContext, test: str = None):
        await ctx.respond(ctx.translator.bot.test.success.format(test=test))

Expected Results

2024-06-20 08:08:09 [CRITICAL] : Error loading command: 400 Bad Request (error code: 50035): Invalid Form Body In 3.options.6: Option names are not unique in locale en-GB But then walk_application_commands should return all the commands excpet the one duplicate

Actual Results

walk_application_commands return None

Intents

all

System Information

2.5

Checklist

Additional Context

cog.get_commands() also return None with that issue

Dorukyum commented 2 months ago

I don't understand, how many commands do you have? Why do you even have a duplicate?

Lulalaby commented 2 months ago

Should we really consider that even a bug? The only way to "fix" that in my eyes, is to throw lib side before sending, when there's a duplicate command name. Tho the dev should always know which command is named what..

nvm that the additional comment, i was tripping

Lumabots commented 1 month ago

I don't understand, how many commands do you have? Why do you even have a duplicate?

its an example, the issue is more than if a command cant be loaded for any reason wrong name or anything else, it will then return 0 commandes for all the other commands