Document channel name and thread name restrictions #5338
Unanswered
MarcusOtter
asked this question in
API Feature Requests & Ideas
Replies: 1 comment 2 replies
-
Reverse engineered findingsFeel free to post replies on this post with your findings and I'll include them. Helps other people implement this until Discord releases their official restrictions. Channel names
Thread names
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Posting to
POST /guilds/{guild.id}/channels
orPOST /channels/{channel.id}/threads
orPOST /channels/{channel.id}/messages/{message.id}/threads
is allowed with any name. However, Discord removes characters that it considers invalid and sometimes replaces it with something else or removed entirely. It would be very beneficial for us developers if this replacement process was documented, preferably with a RegEx of characters that will be transformed, and whether they will be replaced or removed.Suggestion
I believe the Application Command name is documented excellently, and I would love something like this for thread names and channel names:
Usernames and nicknames also has decent documentation on what is allowed in a Discord user name, which one could quite easily create a RegEx for (but it would be even better if it was supplied in the documentation).
Use case
There are many reasons a developer would want to know this. In my case, I let users pick a default name for threads created in a certain channel, which I do from a modal with a text input. Today, if they enter any combination of only invalid characters, I have no way of knowing in advance whether Discord will accept this name or not, because I don't know what the invalid characters are. There is a risk that all of them are invalid. All I can do is blindly accept it and hope it doesn't throw an error once my bot eventually creates the thread (which it would if the input was something like
////#####:::
because the remaining length would be 0 after Discord removes all characters). It's either that or trying to manually find all invalid characters by reverse engineering it before continuing with this feature, which is really frustrating.If you want to help reverse engineering it, reply to this post.
Beta Was this translation helpful? Give feedback.
All reactions