Home Manual Reference Source Repository
import BotConfig from 'discord-graf/src/bot/config.js'
public class | source

BotConfig

Configuration for a bot

Constructor Summary

Public Constructor
public

constructor(values: ConfigObject, defaults: ConfigObject)

Member Summary

Public Members
public
public set

values(values: ConfigObject): *

Adds to the current values, overwriting existing ones

public get

Method Summary

Public Methods
public

loadDefaults(overwrite: boolean)

Adds the defaults to the current values

public

yargs(yargs: Yargs, addOptions: boolean): Yargs

Loads configuration from yargs, adding a bunch of default bot options

Public Constructors

public constructor(values: ConfigObject, defaults: ConfigObject) source

Params:

NameTypeAttributeDescription
values ConfigObject
  • optional

The configuration to start with

defaults ConfigObject
  • optional

The defaults to start with

Public Members

public defaults: ConfigObject source

public set values(values: ConfigObject): * source

Adds to the current values, overwriting existing ones

public get values: ConfigObject source

Public Methods

public loadDefaults(overwrite: boolean) source

Adds the defaults to the current values

Params:

NameTypeAttributeDescription
overwrite boolean
  • optional
  • default: false

Whether or not the defaults should overwrite existing values

public yargs(yargs: Yargs, addOptions: boolean): Yargs source

Loads configuration from yargs, adding a bunch of default bot options

Params:

NameTypeAttributeDescription
yargs Yargs

The yargs instance to use

addOptions boolean
  • optional
  • default: true

Whether or not to add options for GRAF's config

Return:

Yargs

The yargs instance