Skip to content

User Installation Contexts

Olivia edited this page Jun 8, 2024 · 1 revision

⚠️ This page is a work in progress! It might be subject to changes until the associated PR is merged!

As of TODO: FILL ME WHEN RELEASED, JDA-Chewtils now supports messaged being installed in user contexts. Here's how to do it, with a migration guide from the old system.

User Installable Commands

There is a new this.contexts option for Interactions. To enable it, start off by adding this:

this.contexts = new InteractionContextType[]{};

Now, depending on where you want it to be accessed, you can do the following:

Migration from this.guildOnly

If you still use the legacy this.guilyOnly, you need to replace that with one of the following:

  1. this.guildOnly = true => this.contexts = new InteractionContextType[]{InteractionContextType.GUILD};
  2. this.guildOnly = false (and you want it to be used everywhere) => this.contexts = new InteractionContextType[]{InteractionContextType.GUILD, InteractionContextType.BOT_DM, InteractionContextType.PRIVATE_CHANNEL};
  3. this.guildOnly = false (but you just want it used in Bot DMs) => this.contexts = new InteractionContextType[]{InteractionContextType.GUILD, InteractionContextType.BOT_DM};