# Config

A config class for Chariot.js holding all vital instantiation information needed.

# Constructor

Instantiation: new Config(token, chariotOptions [,erisOptions]);

Parameter Type Optional Default Description
token String N/A Your Discord API bot application token
chariotOptions Object N/A Chariot.js options & configuration
chariotOptions.prefix String[] N/A Prefix(es) for triggering commands
chariotOptions.guildPrefixes Object[] N/A Custom per-guild prefixes
chariotOptions.defaultHelpCommand Boolean false Use the default Help command or not
chariotOptions.primaryColor Color Random Main color for the default help embed
chariotOptions.owner String[] N/A An array with all IDs "owning" the bot
chariotOptions.excludeDirectories String[] N/A An array with all folder names to ignore
chariotOptions.customLocales Object N/A Custom locales. See Locales.
erisOptions Object N/A All Eris options. Reference

# Per-Guild Prefixes

Chariot.js supports per-guild prefixes in addition to the default set of prefixes as of version 3.4.0.

Per-Guild Prefixes are passed as an array of object(s) with following API:

Parameter Type Optional Default Description
guildPrefixes Object N/A A Per-Guild prefix object
guildPrefixes.guildID String N/A The ID of the Guild for the custom prefix
guildPrefixes.prefix String N/A The new custom prefix for the guild specified

If more than 1 custom prefix is wished to be registered for a single guild, simply add another object with the same Guild ID and a new prefix. Chariot.js will automatically assign and filter all prefixes to their corresponding Guild IDs.

Specifying an array of prefixes in a single object like { guildID: 'ID', prefix: ['!', ';'] } isn't supported!

Please see the Example down below for a practical use-case.

# Mention Prefix

Chariot.js supports the use of a mention prefix as of version 3.4.0 in order to ping the bot for command invocation.

Simply pass @mention in the Array of default prefixes as shown in the Example below.

Chariot.js automatically injects the logged-in client's user credentials for a super simple and dynamic per-client use and respects that data dynamically across the entire application, even in the default Help command!

# Example

Here's a super simple example for a Chariot.Config object:

new Chariot.Config(
    '<TOKEN>', 
    {
        prefix: ['c!', '!', '@mention'],
        guildPrefixes: [
            { guildID: '0123456789', prefix: '&' },
            { guildID: '0123456789', prefix: '?' },
            { guildID: '9876543210', prefix: ';' }
        ],
        defaultHelpCommand: true,
        primaryColor: 'ORANGE',
        owner: [
            '<Discord Snowflake 1>',
            '<Discord Snowflake 2>',
            '<Discord Snowflake n>'
        ],
        excludeDirectories: [
            'super_secret_folder_1',
            'super_secret_folder_2',
            'super_secret_folder_n'
        ],
        customLocales: {
            missingPermissions: 'Command **{command}** requires following permissions: **{missingPermissions}**',
            owner: 'You should not be playing around with this!',
            cooldown: 'Just wait **{timeLeftFormatted}** before spamming **{command}** yet again ...',
            nsfw: '**{command}** is an NSFW command and cannot be used here.',
            userPermissions: {
                title: 'Hold up ...',
                description: 'I need you to make sure you have following permissions before using this command: **{missingUserPermissions}**',
            }
        }
    },
    {
        messageLimit: 50,
        defaultImageFormat: 'png'
    }
);