All tools / Commands

Installation and interaction context planner

Build integration_types and contexts for a command, and flag user-install rules that change where it can run.

Install, then surface

integration_types is where the app is installed: 0 guild, 1 user. contexts is where a command can be used: 0 guild, 1 bot DM, 2 other DMs and group DMs. PRIVATE_CHANNEL only matters when the command includes USER_INSTALL. New apps support guild install only until you change that. Adding an install context on the app does not update existing commands; each command needs its own integration_types. A user-installed app in a server is limited to what that user can do, so a non-ephemeral reply fails where the user cannot send messages. Contexts do not change guild command permission overwrites.

Related: authorizing_integration_owners explainer · OAuth2 scope and install-context URL