Conversation
|
I have not tested this feature yet so the pull request will be a draft for now. |
bsian03
left a comment
There was a problem hiding this comment.
Missing ApplicationCommand typings. Also when you lint, please use the script provided in package.json
Co-authored-by: bsian03 <chharry321@gmail.com>
(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.
Still missing interaction metadata implementation (deprecating message.interaction). Lint typings
There was a problem hiding this comment.
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.