refactor(ChatInputCommandInteraction): use slash command mention instead of a string representation #8532
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR blocked
Can be merged once API docs PR is merged.
Please describe the changes this PR makes and why it should be merged:
As all the other classes (e.g. User, TextChannel, Role) follows the documented message formatting for formatting in
.toString()
, the slash command interactions should too.This PR replaces the old functionality which returns a string representation that can be pasted into the client to use a slash command, however, is client-sided only and not documented.
<ChatInputCommandInteraction>.toString()
->/pet user:1234567890123456789
<ChatInputCommandInteraction>.toString()
-></pet:9876543210987654321>
Client preview:
This PR also adds a new method to builders,
chatInputMention()
, which implements the new functionality mentioned above.Since this replaces the functionality of the same method, this is a breaking change and is a major for
discord.js
(only a minor for@discordjs/builders
).Status and versioning classification: