-
Notifications
You must be signed in to change notification settings - Fork 412
feat: user-installables #1532
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
base: dev
Are you sure you want to change the base?
feat: user-installables #1532
Conversation
|
I have not tested this feature yet so the pull request will be a draft for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please lint.
bsian03
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing ApplicationCommand typings. Also when you lint, please use the script provided in package.json
Co-authored-by: bsian03 <[email protected]>
(again: prettier added the commans for some reason)
|
discord/discord-api-docs#6958 may need to be looked at in relation to this as well |
|
Oh sorry, I didn't see that USE_EXTERNAL_APPs has been implemented already. |
bsian03
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still missing interaction metadata implementation (deprecating message.interaction). Lint typings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Discord's user-installable application commands, enabling bots to be installed by users directly and used across different contexts (guilds, bot DMs, and private interactions).
- Adds context properties to track where interactions originate (guild, bot DM, or private/user-installable)
- Introduces new interaction metadata handling for better tracking of interaction chains
- Updates Guild fallback logic to handle cases where guild data isn't cached
Reviewed Changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/Constants.js | Adds new constants for command context types and integration types |
| lib/structures/Interaction.js | Adds authorizingIntegrationOwners property to track installation ownership |
| lib/structures/CommandInteraction.js | Adds context property and Guild fallback for uncached guilds |
| lib/structures/ComponentInteraction.js | Adds context property and Guild fallback for uncached guilds |
| lib/structures/AutocompleteInteraction.js | Adds context property and Guild fallback for uncached guilds |
| lib/structures/ModalSubmitInteraction.js | Adds context property and Guild fallback for uncached guilds |
| lib/structures/ApplicationCommand.js | Adds contexts and integrationTypes properties for command configuration |
| lib/structures/Message.js | Adds comprehensive interaction metadata parsing and deprecates old interaction property |
| lib/Client.js | Updates createCommand to support new context and integration type parameters |
| examples/userCommand.js | Provides example implementation of user-installable commands |

This pull requests adds the ability to configure application command context which allows the creation of user-installable commands.