Interface ClientOptions

The options for the Client

interface ClientOptions {
    allowedMentions?: MessageMentionOptions;
    closeTimeout?: number;
    componentPaths?: {
        buttons?: string;
        embeds?: string;
        modals?: string;
        selectMenus?: string;
        textInputs?: string;
    };
    defaultCooldownSeconds?: number;
    failIfNotExists?: boolean;
    guildPrefixes?: Record<string, string>;
    handlerPaths?: {
        autocompletes?: string;
        events?: string;
        messageCommands?: string;
        messageContextMenuCommands?: string;
        slashCommands?: string;
        userContextMenuCommands?: string;
    };
    intents: BitFieldResolvable<"Guilds" | "GuildMembers" | "GuildModeration" | "GuildBans" | "GuildEmojisAndStickers" | "GuildIntegrations" | "GuildWebhooks" | "GuildInvites" | "GuildVoiceStates" | "GuildPresences" | "GuildMessages" | "GuildMessageReactions" | "GuildMessageTyping" | "DirectMessages" | "DirectMessageReactions" | "DirectMessageTyping" | "MessageContent" | "GuildScheduledEvents" | "AutoModerationConfiguration" | "AutoModerationExecution", number>;
    jsonTransformer?: ((obj) => unknown);
    makeCache?: CacheFactory;
    ownerIds?: string[];
    partials?: Partials[];
    prefix?: string;
    presence?: PresenceData;
    privateGuildIds?: string[];
    rest?: Partial<RESTOptions>;
    shardCount?: number;
    shards?: number | number[] | "auto";
    sweepers?: SweeperOptions;
    waitGuildTimeout?: number;
    ws?: WebSocketOptions;
}

Hierarchy

  • ClientOptions
    • ClientOptions

Properties

allowedMentions?: MessageMentionOptions
closeTimeout?: number
componentPaths?: {
    buttons?: string;
    embeds?: string;
    modals?: string;
    selectMenus?: string;
    textInputs?: string;
}

The paths for the components

Type declaration

  • Optional buttons?: string

    The path to the buttons directory

  • Optional embeds?: string

    The path to the embeds directory

  • Optional modals?: string

    The path to the modals directory

  • Optional selectMenus?: string

    The path to the select menus directory

  • Optional textInputs?: string

    The path to the text inputs directory

defaultCooldownSeconds?: number

The default cooldown for the commands

Default

0

failIfNotExists?: boolean
guildPrefixes?: Record<string, string>

A map of guild IDs to prefixes for the message commands

Default

{}

Example

const client = new Client({
// ...
guildPrefixes: {
'1180237364707217409': '?',
'1188147841533739048': '$',
'985223450916450324': '&'
}
});
handlerPaths?: {
    autocompletes?: string;
    events?: string;
    messageCommands?: string;
    messageContextMenuCommands?: string;
    slashCommands?: string;
    userContextMenuCommands?: string;
}

The paths for the handlers

Type declaration

  • Optional autocompletes?: string

    The path to the autocompletes directory

  • Optional events?: string

    The path to the events directory

  • Optional messageCommands?: string

    The path to the message commands directory

  • Optional messageContextMenuCommands?: string

    The path to the message context menu commands directory

  • Optional slashCommands?: string

    The path to the slash commands directory

  • Optional userContextMenuCommands?: string

    The path to the user context menu commands directory

intents: BitFieldResolvable<"Guilds" | "GuildMembers" | "GuildModeration" | "GuildBans" | "GuildEmojisAndStickers" | "GuildIntegrations" | "GuildWebhooks" | "GuildInvites" | "GuildVoiceStates" | "GuildPresences" | "GuildMessages" | "GuildMessageReactions" | "GuildMessageTyping" | "DirectMessages" | "DirectMessageReactions" | "DirectMessageTyping" | "MessageContent" | "GuildScheduledEvents" | "AutoModerationConfiguration" | "AutoModerationExecution", number>
jsonTransformer?: ((obj) => unknown)

Type declaration

    • (obj): unknown
    • Parameters

      • obj: unknown

      Returns unknown

makeCache?: CacheFactory
ownerIds?: string[]

The IDs of the owners of the bot

Default

[]

partials?: Partials[]
prefix?: string

The prefix for the message commands

Default

'!'

presence?: PresenceData
privateGuildIds?: string[]

The IDs of the private guilds of the bot

Default

[]

rest?: Partial<RESTOptions>
shardCount?: number
shards?: number | number[] | "auto"
sweepers?: SweeperOptions
waitGuildTimeout?: number
ws?: WebSocketOptions

Generated using TypeDoc