discord.js
discord.js copied to clipboard
feat: user-installable apps
Please describe the changes this PR makes and why it should be merged: This PR adds support for User-Installable Apps
Depends on:
- https://github.com/discord/discord-api-docs/pull/6723
- https://github.com/discord/discord-api-docs/pull/6765
- https://github.com/discord/discord-api-docs/pull/6782
- https://github.com/discord/discord-api-docs/pull/7070
This PR will be in Draft status during the preview state of User-Installable Apps
Status and versioning classification:
- [x] Code changes have been tested against the Discord API, or there are no code changes
- [x] I know how to update typings and have done so, or typings don't need updating
- [x] This PR changes the library's interface (methods or parameters added)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| discord-js | ⬜️ Ignored (Inspect) | Visit Preview | Sep 1, 2024 8:40pm | |
| discord-js-guide | ⬜️ Ignored (Inspect) | Visit Preview | Sep 1, 2024 8:40pm |
this pr does not close #10215 btw, this updates discord.js but not the builders (the linked issue only requested it for builders)
This is a draft. It is not finalised yet.
i know, just pointing it out as the description isnt accurate right now 🤷♀️
@Syjalo Discord said the user-installable apps will come out of beta on June 18th, can I help with something to get this pr done?
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 35.45%. Comparing base (
4374374) to head (b2e0d7d). Report is 2 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #10227 +/- ##
=======================================
Coverage 35.45% 35.45%
=======================================
Files 228 228
Lines 14319 14319
Branches 1254 1254
=======================================
Hits 5077 5077
Misses 9198 9198
Partials 44 44
| Flag | Coverage Δ | |
|---|---|---|
| builders | 91.58% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
https://github.com/discordjs/discord.js/blob/efa16a6095e012ff4d138b21d128df5f407fc93c/packages/discord.js/src/client/actions/InteractionCreate.js#L50 stops MessageComponentInteractions to happen in PartialGroupDMChannel; they don‘t qualify as isTextBased() because that checks for a .messages Manager to exist which is not the case for group DM channel.
So that check probably needs to be changed for user apps to work
channel will be true there with Partials.Channel. Sad. It looks like that will also affect InteractionType.ApplicationCommand -> ApplicationCommandType.Message.
Since it's already working fine without that partial, a fix could be to exit out if channel is defined and it's the partial group direct message channel.
Would probably need to update this too then to be ?(TextBasedChannels|PartialGroupDMChannel):
https://github.com/discordjs/discord.js/blob/efa16a6095e012ff4d138b21d128df5f407fc93c/packages/discord.js/src/structures/BaseInteraction.js#L130-L137
However, I'm pretty sure widening the scope of a type would be a breaking change...
Welcoming thoughts.
https://github.com/discordjs/discord.js/blob/efa16a6095e012ff4d138b21d128df5f407fc93c/packages/discord.js/src/client/actions/InteractionCreate.js#L50
stops MessageComponentInteractions to happen in
PartialGroupDMChannel; they don‘t qualify asisTextBased()because that checks for a.messagesManager to exist which is not the case for group DM channel. So that check probably needs to be changed for user apps to work
We probably should add a .messages property as MessageManager to PartialGroupDMChannel because https://github.com/discordjs/discord.js/blob/bf6761a44adec1fe5017f6bf5d8bc0734916961f/packages/discord.js/src/structures/Webhook.js#L232 for example also needs that to exist (getting called from <Interaction>.followUp(…)) and would even add a Message to it…
This could be implemented in this pull request:
- https://github.com/discord/discord-api-docs/pull/7070
I just wanted to confirm if this also fixes the issue with group dm's message context menu interactions not triggering the interaction event in discord.js? Or do I need to open an issue for that?
I just wanted to confirm if this also fixes the issue with group dm's message context menu interactions not triggering the interaction event in discord.js?
It will
Well..this explains why my commands don't show up as a user installed bot.
Please get this in and released asap, this is badly needed!