Skip to content
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

Update commands.md #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update commands.md #41

wants to merge 2 commits into from

Conversation

Azim
Copy link

@Azim Azim commented Nov 13, 2021

I dont know why this isnt in discord docs, but having empty space as part of option name gives "regex failed" error

I dont know why this isnt in discord docs, but having empty space as part of option name gives "regex failed" error
@@ -252,6 +252,7 @@ api.batchUpdateSlashCommandPermissions(server, Arrays.asList(builder1, builder2)
- Your app cannot have two server commands within the same name on the same guild
- Your app can have a global and guild command with the same name
- Multiple apps can have commands with the same names
- Names cannot contain empty spaces
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is an "empty" space?
Especially compared to a "non-empty" space.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poor choice of words on my part. I meant space " " symbol.
I havent tested it with special characters, but if they forbid " ", i'd expect that it only allows a-Z and 0-9

@felldo
Copy link
Member

felldo commented Nov 13, 2021

It is mentioned in the Discord Docs https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-naming .

CHAT_INPUT command names and command option names must match the following regex ^[\w-]{1,32}$ with the unicode flag set. If there is a lowercase variant of any letters used, you must use those. Characters with no lowercase variants and/or uncased letters are still allowed. USER and MESSAGE commands may be mixed case and can include spaces.

And I would consider saying that spaces are not allowed is not appropiate here as there is even more that is not allowed except for ^[\w-]{1,32}$

Copy link
Member

@Saladoc Saladoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the changes I ask you to consider, please squash your commits into one.

@@ -252,6 +252,7 @@ api.batchUpdateSlashCommandPermissions(server, Arrays.asList(builder1, builder2)
- Your app cannot have two server commands within the same name on the same guild
- Your app can have a global and guild command with the same name
- Multiple apps can have commands with the same names
- Command names and command option names must match the following regex `^[\w-]{1,32}$` with the unicode flag set.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There really should be a description here that's also accessible to people less familiar with regex. A potential phrasing:

Suggested change
- Command names and command option names must match the following regex `^[\w-]{1,32}$` with the unicode flag set.
- Command names and command option names must be 1 to 32 characters long
- Command names and command option names may only contain letters, numbers, and the underscore (`_`) and dash (`-`) characters. To be precise, they must match the regex `^[\w-]{1,32}$` with the unicode flag set.

@@ -252,6 +252,7 @@ api.batchUpdateSlashCommandPermissions(server, Arrays.asList(builder1, builder2)
- Your app cannot have two server commands within the same name on the same guild
Copy link
Member

@Saladoc Saladoc Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're touching this up, we might as well fix this typo.

Suggested change
- Your app cannot have two server commands within the same name on the same guild
- Your app cannot have two server commands with the same name on the same server

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you are at it, We usually call servers "server", not "guild". :-)

@@ -252,6 +252,7 @@ api.batchUpdateSlashCommandPermissions(server, Arrays.asList(builder1, builder2)
- Your app cannot have two server commands within the same name on the same guild
- Your app can have a global and guild command with the same name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Your app can have a global and guild command with the same name
- Your app can have a global and server command with the same name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants