Type Alias CommandEnabledOptions<GuildOnly>

CommandEnabledOptions: { global: boolean; nsfw: boolean } & (
    | { guildOnly: GuildOnly; guilds: string[] }
    | {
        dm: boolean;
        guildOnly: false;
        guilds: boolean | string[];
        privateChannel: boolean;
    }
)

Type Parameters

  • GuildOnly extends boolean

Type declaration

  • global: boolean

    Wether or not this command is enabled globally. If false, all other options are ignored - allowing you to "temporarily" disable a command without removing it from the codebase or changing any other options.

    true
    
  • nsfw: boolean

    Wether or not this command is considered "Not Safe For Work", and therefor not allowed/made available in channels thats are not explicitely marked as NSFW.

    • If true, the command will only be available in NSFW channels.
    • If false, the command will be available in all channels.
    false
    
  • { guildOnly: GuildOnly; guilds: string[] }
    • guildOnly: GuildOnly

      Wether or not this command is ONLY enabled in the InteractionContextType.Guild context. All of the other context options are ignored if this is set to true, and the interaction for the command will be narrowed down to a "guild" interaction.

    • guilds: string[]

      An array of guild IDs where this command is enabled.

      • If undefined, the command is enabled in all guilds.
      • If an empty array, the command is disabled in all guilds.
      • If an array of strings with length, the command is enabled in the guilds with the specified IDs.

      Default:

      • If process.env.NODE_ENV is production, this defaults to undefined.
      • If process.env.NODE_ENV is not production, this defaults to [appConfig.client.development_server_id].
  • {
        dm: boolean;
        guildOnly: false;
        guilds: boolean | string[];
        privateChannel: boolean;
    }
    • dm: boolean

      Wether or not this command is enabled in the InteractionContextType.BotDM context (aka DMs with the app's bot user).

      • Please note that a User Install is required before users are able to interact with the bot in DMs.
      false
      
    • guildOnly: false
    • guilds: boolean | string[]

      Wether or not this command is enabled in the InteractionContextType.Guild context.

      • If true, the command will be enabled in all guilds.
      • If false, the command will not be available in the Guild context, and therefor be disabled in all guilds.
      • If an array of strings with length, the command will be only enabled in the guilds with the specified IDs.

      Default:

      • If process.env.NODE_ENV is production, this defaults to true.
      • If process.env.NODE_ENV is not production, this defaults to [appConfig.client.development_server_id].
    • privateChannel: boolean

      Wether or not this command is enabled in the InteractionContextType.PrivateChannel context (aka Group DMs and DMs other than the app's bot user)

      • Please note that a User Install is required before users are able to interact with the bot in DMs.
      false