discord-api-docs
discord-api-docs copied to clipboard
Copying and Pasting Localized Slash Commands on the Chat Box does not bring up the Command Picker, unless if you type the original non-localized name
Description
If you copy and paste a slash command from the chat box that has localized labels, Discord won't suggest the command until you rewrite the text in the chat box to use the original non-localized label.
Steps to Reproduce
- Have a command that has localized name
- Type the command with its arguments
- Copy the command from the chat box
- Delete the command from the chat box
- Paste the command to the chat box, notice that Discord won't suggest using the
/localized commandUNTIL you rewrite the text in the chat box to/nonlocalized command
Expected Behavior
If I copy and pasted /sonhos pagar user:@MrPowerGamerBR#4185 quantity:100, Discord should suggest to use /sonhos pagar without me changing the pagar name to pay.
Current Behavior
Discord doesn't suggest the localized command until I rewrite the pasted command with the original non-localized label.
Screenshots/Videos
English: https://user-images.githubusercontent.com/9496359/189200926-e667b5f9-991f-45e0-8362-8a5ea098bb7d.mp4
Portuguese: https://user-images.githubusercontent.com/9496359/189201176-03d3dac8-c81a-4ff6-8696-17394c6fd273.mp4
Client and System Information
Canary 146049 (3a5271c) Host 1.0.49 Windows 10 64-Bit (10.0.19044)
Something that my friend pointed out recently: On his Discord server, he can paste the localized commands without needing to rewrite to use the non-localized label, and I tested it and sure enough, I can paste the command without needing to change anything about it.
However I'm not sure why it works on his server, maybe it is because I have multiple bots with the same command label on my test server?
The difference is that running a discord bot with the client method, you get everything typed with the /command and you can pull the other data out. If you run the interactions url method, you need to register your commands and what the options are for after the command. Discord detect it and adds in the option name you're using automatically.
This registration would require the name of the option : then the option value. So while a client based bot would accept /link CODE, the interaction url bot would pre-format to /link code:CODE as you type. If you paste in the full /link CODE, it doesn't get a chance to reformat it so it doesn't recognize it as a command because the post /command value isn't associated with any of the options.
