New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot name 2 application commands of different types the same name #954
Comments
Are you sure that it is an error from pycord? |
context menu description and option?. Also this does not occur with beta 1 |
ok, we need more code for this to trace it back |
can user commands not have descriptions? |
nvm, i tested errors still occur when removing descriptions i could find |
i need to run some tests on my bot code with context menu commands |
i have edited the issue with all lines that declare context menu commands |
im sorry but i gtg. I will continue to diagnose this in 20 hours. i am very busy and program my bot in my spare time |
yeah, thank u! |
I have noticed I have made a few errors in copying the code. I copied some of the wrong lines. I have temporarily corrected the lines to what I think they were. I will re-paste the correct lines in 18 hours when I have access to the latest bot code I am working on |
All fine. We have time. |
i have updated the reproduction code with the correct code and some extra info |
thank you |
i have updated the issue with some extra errors |
i have rewritten the issue because i found what the problem appears to be |
I just encountered the same bug and believe I might have found the error in the code. To register the commands for cmd in desynced:
if cmd["action"] == "delete":
pending_actions.append(
{
"action": "delete",
"command": cmd["id"],
"name": cmd["command"],
}
)
continue
# We can assume the command item is a command, since it's only a string if action is delete
match = get(pending, name=cmd["command"].name)
if match is None:
continue
if cmd["action"] == "edit":
pending_actions.append(
{
"action": "edit",
"command": match,
"id": cmd["id"],
}
) Going through the loop with The described behaviour happened on the second call of the function in my code. This might be fixed by editing the When I was debugging this I used version 2.0.0-beta3, the code snippet is from the current master. |
im getting errors saying context menu errors for slash commands with the same name, after i have removed the user commands |
i am able to get rid of this other error if i flush all application commands |
i accidentally hit the application command limit while doing this. so only do it once edit: the rate limit mysteriously disappeared. its supposed to last 24 hours |
This issue should be fixed with #1208 |
Ok, will test if the issue still occurs |
can confirm this no longer occurs on the #1208 branch |
ignore what said about before about everything being broken. I don't think it relates to this at all. I've been getting strange and unexpected behaviour with slash commands in general |
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
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
Checklist
Additional Context
The text was updated successfully, but these errors were encountered: