Skip to content

Conversation

@retrouser955
Copy link

@retrouser955 retrouser955 commented Aug 25, 2024

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

@retrouser955 retrouser955 marked this pull request as draft August 25, 2024 07:32
@retrouser955
Copy link
Author

I have not tested this feature yet so the pull request will be a draft for now.

@retrouser955
Copy link
Author

retrouser955 commented Aug 25, 2024

Hey, I just have a couple of questions. Would you add the context of the application command usage CommandInteraction or CommandInteractionData?

Right now, I have it set to the former and I was just checking if changes are needed.
image

Edit: Question answered via Discord

@retrouser955 retrouser955 marked this pull request as ready for review August 25, 2024 15:35
Copy link
Collaborator

@bsian03 bsian03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please lint.

Copy link
Collaborator

@bsian03 bsian03 left a 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

@retrouser955 retrouser955 requested a review from bsian03 August 26, 2024 16:35
@bsian03
Copy link
Collaborator

bsian03 commented Oct 19, 2024

discord/discord-api-docs#6958 may need to be looked at in relation to this as well

@bsian03
Copy link
Collaborator

bsian03 commented Oct 20, 2024

@bsian03 bsian03 mentioned this pull request Nov 1, 2024
55 tasks
@retrouser955
Copy link
Author

Oh sorry, I didn't see that USE_EXTERNAL_APPs has been implemented already.

Copy link
Collaborator

@bsian03 bsian03 left a 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

@retrouser955 retrouser955 requested a review from bsian03 December 19, 2024 02:27
@bsian03 bsian03 requested a review from Copilot September 27, 2025 21:15
Copy link

Copilot AI left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants