Global

Type Definitions

CommandAction(bot, context) → {CommandResults|Promise.<CommandResults>}

Parameters:
Name Type Description
bot T

The DataClient.

context CommandContext.<T>

The CommandContext.

Returns:
Type
CommandResults | Promise.<CommandResults>

CommandContext

Properties
Name Type Description
params Array.<string>

The parsed params that make up the invoking message.

msg Message

The message from Discord (link).

channel TextableChannel | GuildChannel

The channel the message was sent in (link) (link).

CommandData

Properties
Name Type Attributes Description
name string

The command name.

description string

The command description.

run CommandAction.<T>

The command function.

options CommandOptions.<T> <optional>

The command options.

CommandMiddlewareData

Properties
Name Type Attributes Default Description
failMessage string <optional>
''

A message to send if the middleware fails.

run MiddlewareRun <optional>
async () => null

The middleware runner.

CommandOptions

Properties
Name Type Attributes Default Description
aliases Array.<string> <optional>
[]

List of alias names for the command.

parameters Array.<string> <optional>
[]

List of paremeters that the command takes.

permission Permission <optional>

The permission threshold needed to execute this command.

postHook PostHook <optional>

A function to run after successful execution of a command.

deleteInvoking boolean <optional>
true

Whether or not the bot should delete the message that invoked this command.

deleteResponse boolean <optional>
true

Whether or not the bot should delete the message response from this command.

deleteResponseDelay number <optional>
10000

How many miliseconds to wait before deleting the bots response.

subCommands Array.<Command.<T>> <optional>

The sub commands.

dmOnly boolean <optional>
false

Whether or not the command can only be used in a DM channel (overrides guildOnly).

dmOnly boolean <optional>
true

Whether or not the command can only be used in a Guild channel.

CommandResults

Type:

ConnectionData

Properties
Name Type Description
connectionInfo ConnectionInfo | string

The data used to connect to the database as an object or connection string.

client string

The database driver to use.

pool PoolInfo

The pooling config.

ConnectionInfo

Properties
Name Type Attributes Description
database string

The database name to use.

user string

The user to login as.

password string <optional>

The password to use to login

host string

The host/url/ip to connect to.

DatabaseManagerOptions

Properties
Name Type Description
DataObject DatabaseObjectBuilder

DatabaseObject constructor to structure database values.

DataQuery DatabaseQueryBuilder

DatabaseQuery constructor to structure database values.

DatabaseObjectBuilder(…params) → {DatabaseObject}

Parameters:
Name Type Attributes Description
params any <repeatable>

The params.

Returns:
Type
DatabaseObject

DatabaseObjectOptions

Properties
Name Type Attributes Default Description
isNew boolean <optional>
false

Whether or not to treat this as a new record.

DatabaseQueryBuilder(…params) → {DatabaseQuery}

Parameters:
Name Type Attributes Description
params any <repeatable>

The params.

Returns:
Type
DatabaseQuery

DataClientOptions

Properties
Name Type Attributes Description
databaseManager DatabaseManager <optional>

The DatabaseManager.

oratorOptions OratorOptions <optional>

Params to pass to the Orator class.

statusManagerOptions StatusManagerOptions <optional>

StatusManagerOptions object.

options.erisOptions Object <optional>

Options to pass to Eris Client.

DiscordEventData

Properties
Name Type Description
name string

The event name.

run DiscordEventRunner

The function to run when the event occurs.

DiscordEventRunner(bot, …rest) → {void}

Parameters:
Name Type Attributes Description
bot DataClient

The DataClient.

rest any <repeatable>

The rest.

Returns:
Type
void

Loadable

Type:

LoadableObject

Type:

MessageData

Properties
Name Type Description
content string

The message content.

MiddlewareRun(bot, context) → {Promise.<unknown>|unknown}

Parameters:
Name Type Description
bot DataClient

The DataClient.

context CommandContext

The CommandContext.

Returns:
Type
Promise.<unknown> | unknown

OratorOptions

Properties
Name Type Attributes Default Description
defaultPrefix string <optional>

The default command prefix.

deleteInvoking boolean <optional>
false

Default behavior for whether or not the bot should delete the message that invoked a command.

deleteResponse boolean <optional>
false

Default behavior for whether or not the bot should delete the message response from a command.

deleteResponseDelay number <optional>
10000

Default behavior for how many miliseconds to wait before deleting the bots response from a command.

PermissionData

Properties
Name Type Attributes Default Description
level number <optional>
0

The level of the permission (0 is the bottom).

failMessage string <optional>
'You do not have the required permissions.'

A message when a user does not meet the permission level.

run MiddlewareRun <optional>
() => { return true }

A test to see if a member has this permission.

PermissionRun(bot, context) → {Promise.<boolean>|boolean}

Parameters:
Name Type Description
bot DataClient

The DataClient.

context CommandContext

The CommandContext.

Returns:
Type
Promise.<boolean> | boolean

PoolInfo

Properties
Name Type Description
min number

The minimum number of connections.

max number

The maximum number of connections.

PostHook(bot, context, response) → {void}

Parameters:
Name Type Description
bot T

The DataClient.

context CommandContext.<T>

The CommandContext.

response Message

The message response from the bot (link).

Returns:
Type
void

SettingCommandData

Type:
Properties
Name Type Description
getValue SettingCommandGetValue.<T>

The getValue function.

displayName string

The name to print when listing this setting.

setting string | Promise.<string>

The name of the setting to use with the dbm.

SettingCommandGetValue(context) → {string}

Parameters:
Name Type Description
context CommandContext.<T>

The CommandContext.

Returns:

The value of the Setting.

Type
string

StatusManagerOptions

Properties
Name Type Attributes Default Description
mode string <optional>
'manual'

The mode of the StatusManager, either 'manual' or 'random'.

interval number <optional>
43200000

The amount of time to wait before randomly changing status (requires 'random' mode).

defaultStatus Status

The default status of the bot.

SubQuery

Properties
Name Type Description
type SubQueryType

The type of SubQuery.

query DatabaseQuery

The SubQuery.

SubQueryType

Type:
  • 'and' | 'or'