discord.js icon indicating copy to clipboard operation
discord.js copied to clipboard

feat: add `applicationCommandMention()` formatter

Open almeidx opened this issue 3 years ago • 7 comments
trafficstars

Please describe the changes this PR makes and why it should be merged:

  • Added applicationCommandMention() formatted in /builders
  • Added ApplicationCommand#toString(), which will use the function mentioned above to return the commands mention

Upstream:

  • discord/discord-api-docs#5186

Status and versioning classification:

  • This PR changes the library's interface (methods or parameters added)

almeidx avatar Jul 13 '22 17:07 almeidx

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
discord-js ✅ Ready (Inspect) Visit Preview Jul 27, 2022 at 0:03AM (UTC)

vercel[bot] avatar Jul 13 '22 17:07 vercel[bot]

Codecov Report

Merging #8280 (a59d422) into main (ba6797e) will increase coverage by 0.11%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #8280      +/-   ##
==========================================
+ Coverage   86.40%   86.51%   +0.11%     
==========================================
  Files          87       87              
  Lines        8221     8290      +69     
  Branches     1098     1102       +4     
==========================================
+ Hits         7103     7172      +69     
  Misses       1075     1075              
  Partials       43       43              
Flag Coverage Δ
builders 100.00% <100.00%> (ø)
collection 100.00% <ø> (ø)
proxy 73.28% <ø> (ø)
rest 92.53% <ø> (ø)
utilities 100.00% <ø> (ø)
voice 64.08% <ø> (ø)
ws 60.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/builders/src/messages/formatters.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

codecov[bot] avatar Jul 13 '22 17:07 codecov[bot]

This PR needs a rebase.

kyranet avatar Jul 17 '22 19:07 kyranet

Rebased

almeidx avatar Jul 17 '22 20:07 almeidx

This should also be used in https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/structures/ChatInputCommandInteraction.js

manuelvleeuwen avatar Jul 30 '22 10:07 manuelvleeuwen

This should also be used in https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/structures/ChatInputCommandInteraction.js

You cannot include options in command mentions

almeidx avatar Jul 30 '22 14:07 almeidx

This should also be used in https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/structures/ChatInputCommandInteraction.js

You cannot include options in command mentions

That's true, but now that there are attachment options, ChatInputCommandInteraction#toString is not 100% working anymore, and now that there is an official application command mention format, I feel like we should use the official method instead of a custom, not fully working one.

manuelvleeuwen avatar Jul 30 '22 15:07 manuelvleeuwen

Can't reopen this pull request now. Made a new one, #8546

almeidx avatar Aug 22 '22 20:08 almeidx