Summary
with version beta 4 i can no longer name 2 application commands the same name even though one is a slash command and one is a user command. this did not occur with version beta 1 and earlier.
Reproduction Steps
name 2 application commands of different types the same name.
Minimal Reproducible Code
# create 2 application commands with the same name
# first the slash command
@commands.slash_command(name='unmute', description="Unmute a user", guild_ids=config.slash_guilds)
@commands.has_permissions(manage_roles=True)
@commands.bot_has_permissions(manage_roles=True, send_messages=True)
async def slash_unmute(self, ctx, member: discord.Member, reason: discord.Option(str, "Reason for muting user",
required=False)):
await self.unmute(ctx, member, reason)
# now the context command
@commands.user_command(name='unmute', guild_ids=config.slash_guilds)
@commands.has_permissions(manage_roles=True)
@commands.bot_has_permissions(manage_roles=True, send_messages=True)
async def user_unmute(self, ctx, member: discord.Member):
await self.unmute(ctx, member)
Expected Results
add both without a problem. like version beta 1 and earlier
Actual Results
gave the following exception:
Ignoring exception in on_connect
Traceback (most recent call last):
File "/bot-directory/venv/lib/python3.10/site-packages/discord/client.py", line 352, in _run_event
await coro(*args, **kwargs)
File "/bot-directory/venv/lib/python3.10/site-packages/discord/bot.py", line 1042, in on_connect
await self.sync_commands()
File "/bot-directory/venv/lib/python3.10/site-packages/discord/bot.py", line 552, in sync_commands
registered_guild_commands[guild_id] = await self.register_commands(
File "/bot-directory/venv/lib/python3.10/site-packages/discord/bot.py", line 460, in register_commands
registered.append(await register("edit", cmd["id"], cmd["command"].to_dict()))
File "/bot-directory/venv/lib/python3.10/site-packages/discord/http.py", line 338, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In description: Context menu commands cannot have description
In options: Context menu commands cannot have options
When trying to run a slash command. another error occurs:
Ignoring exception in on_interaction
Traceback (most recent call last):
File "/bot-directory/venv/lib/python3.10/site-packages/discord/bot.py", line 738, in process_application_commands
command = self._application_commands[interaction.data["id"]]
KeyError: '935791615111483445'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/bot-directory/venv/lib/python3.10/site-packages/discord/client.py", line 352, in _run_event
await coro(*args, **kwargs)
File "/bot-directory/venv/lib/python3.10/site-packages/discord/bot.py", line 1048, in on_interaction
await self.process_application_commands(interaction)
File "/bot-directory/venv/lib/python3.10/site-packages/discord/bot.py", line 753, in process_application_commands
await self.sync_commands()
File "/bot-directory/venv/lib/python3.10/site-packages/discord/bot.py", line 555, in sync_commands
registered_guild_commands[guild_id] = await self.register_commands(
File "/bot-directory/venv/lib/python3.10/site-packages/discord/bot.py", line 461, in register_commands
registered.append(await register("edit", cmd["id"], cmd["command"].to_dict()))
File "/bot-directory/venv/lib/python3.10/site-packages/discord/http.py", line 338, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In description: Context menu commands cannot have description
In options: Context menu commands cannot have options
and sometimes it will not error but not register the context menu command
Intents
default intents, members and presences
System Information
- Python v3.10.1-final
- py-cord v2.0.0-beta
- py-cord pkg_resources: v2.0.0b4
- aiohttp v3.8.1
- system info: Linux 5.13.0-28-generic #31~20.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022
Checklist
- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.
Additional Context
bug