Skip to content

Instantly share code, notes, and snippets.

@devsnek
Last active June 9, 2023 21:41
Show Gist options
  • Save devsnek/a47893004bc0ee577eb8e9fb76b4d57f to your computer and use it in GitHub Desktop.
Save devsnek/a47893004bc0ee577eb8e9fb76b4d57f to your computer and use it in GitHub Desktop.

Application Command Contexts

We are introducing a new contexts field to application commands to allow more granular control of where application commands may be used.

If not specified, the default is currently {GUILD, BOT_DM}

When this new field is present, the dm_permission field is ignored by our systems for permission calculation.

Extensions to the Application Command Structure

Field Type Description Valid Types
contexts array of Application Command Context Types Indicates which contexts this command may be used in all

Application Command Context Types

Name Value Description
GUILD 0 This command can be used within a Guild
BOT_DM 1 This command can be used within a DM with the application's bot
PRIVATE_CHANNEL 2 This command can be used within DMs and Group DMs with users
@ooliver1
Copy link

ooliver1 commented Jun 9, 2023

Why can this not be a flag?

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