Global

Decorators

deprecated(message?: string) → MethodDecorator

Logs a deprecation warning for the decorated class method whenever it is called

Parameters:
Name Type Attributes Description
message
string
<optional>

Method deprecation message

Source:
Decorator type:
MethodDecorator

logger

Property decorator that will automatically assign the Logger singleton instance to the decorated class property

Example:

class Foo {
    @logger private readonly logger: Logger;
    ...

Note: This is a Typescript feature. If using the logger is desired in Javascript you should simply retrieve the singleton instance via Logger.instance()

Source:
Decorator type:
PropertyDecorator

Type Definitions

ArgOpts

Object containing options for controlling how command arguments will be parsed

Type:
Object
Properties:
Name Type Attributes Default Description
separator
string
<optional>
' '

The charactor to separate args by

Source:

BaseStrings

Enum containing all base framework localization string keys

Type:
enum
Source:

CommandInfo

Object containing required Command properties to be passed to a Command on construction

Type:
Object
Properties:
Name Type Attributes Default Description
name
string

See: Command#name

desc
string

See: Command#desc

usage
string

See: Command#usage

info
string
<optional>

See: Command#info

group
string
<optional>
'base'

See: Command#group

aliases
string[]
<optional>
[]

See: Command#aliases

guildOnly
boolean
<optional>
false

See: Command#guildOnly

hidden
boolean
<optional>
false

See: Command#hidden

argOpts
ArgOpts
<optional>

See: Command#argOpts, ArgOpts

callerPermissions
PermissionResolvable[]
<optional>
[]

See: Command#callerPermissions

clientPermissions
PermissionResolvable[]
<optional>
[]

See: Command#clientPermissions

roles
string[]
<optional>
[]

See: Command#roles

ownerOnly
boolean
<optional>
false

See: Command#ownerOnly

overloads
string
<optional>
null

See: Command#overloads

ratelimit
string
<optional>

Sets a rate limit on calls to this command for every user

Source:

DefaultGuildSettings

The default settings to apply to new guilds. Stored under the key 'defaultGuildSettings' in Client#storage

Type:
Object
Properties:
Name Type Attributes Default Description
prefix
string
'/'

Prefix denoting a command call

disabledGroups
string[]
<optional>
[]

Command groups to ignore

Source:

Difference

Represents a difference between two given valid Unix time signatures

Type:
Object
Properties:
Name Type Attributes Description
ms
number
<nullable>

Total number of MS difference

days
number
<nullable>

Number of days spanned

hours
number
<nullable>

Number of hours spanned after higher units are subtracted

minutes
number
<nullable>

Number of minutes spanned after higher units are subtracted

secs
number
<nullable>

Number of seconds spanned after higher units are subtracted

toString()
function

Returns duration formatted as # days, # hours, # mins, # secs

toSimplifiedString()
function

Returns duration formatted as #d #h #m #s

Source:

ExpectArgType

Valid arg type values for expect. Can be one of the following string literals:

'String' | 'Number' | 'User' | 'Member' | 'Role' | 'Channel' | 'Any'

or an Array of possible string literal values if specific string options are desired

Type:
string
|
string[]
Source:

LocalizedCommandInfo

Represents an object containing localization overrides for a command's desc, info, and usage fields

Type:
object
Source:

LogData

Represents an object passed from Logger to any TransportFunctions given to it

Type:
object
Properties:
Name Type Description
timestamp
Date

Holds the time/date for this log

type
string

The log type. Will be one of: LOG | INFO | WARN | ERROR | DEBUG

tag
string

The tag given for this log

text
string

The text content of this log

Source:

LogLevel

Enum containing the different levels of potential logger output. Each level represents itself and everything above it in the enum. The default logger log level is LogLevel.LOG

enum LogLevel
{
    NONE,
    LOG,
    INFO,
    WARN,
    ERROR.
    DEBUG
}
Type:
enum
Source:

MiddlewareFunction

A function that takes a Message object and an array of args, does anything with them, and returns a Tuple where the first item is the Message object and the second item is the array of args

(Message, any[]) => [Message, any[]]

Can be async as long as the returned promise resolves with the tuple containing the message object and the args array as expected.

If a middleware function returns a string, or throws a string/error, it will be sent to the calling channel as a message and the Command execution will be aborted. If a middleware function does not return anything or returns something other than an array or string, the Command will fail silently.

Note: The command dispatcher will attempt to bind the Command instance to the middleware function when called, so this within a middleware function (if it is not an arrow function) will be the Command instance at runtime

Source:

PluginConstructor

Any class that extends and implements Plugin. Not to be confused with an instance of a Plugin.

Source:

ResolveArgType

Valid arg type values for resolve. Can be one of the following string literals:

'String' | 'Number' | 'Duration' | 'User' | 'Member' | 'BannedUser' | 'Channel' | 'Role'
Type:
string
Source:

ResourceLoader

Represents a function assigned to a specific language that takes a string key and an optional TemplateData object and returns a localized string for that language if it exists

Source:

StorageProviderConstructor

Any class that extends and implements StorageProvider and provides an interface with a storage medium allowing data to be stored, retrieved, and manipulated. Not to be confused with an instance of a storage provider.

Source:

TemplateData

Represents an object mapping template keys to string values, where the template keys will be replaced with the provided values in the source string when given to a Lang resource function like Lang.res()

Type:
object
Source:

Transport

Represents a transport object for the Logger.

Type:
object
Properties:
Name Type Attributes Description
transport
TransportFunction

The transport function to use for this transport

level
LogLevel
<optional>

The log level for this transport. Will default dynamically to the Logger's log level if none is provided

Source:

TransportFunction(data: LogData)

Represents a function to be given to Logger#addTransport that will receive log data. What is done with that log data is up to you, but logging to a file or a database would be some examples

Parameters:
Name Type Description
data
LogData

The data received from the logger

Source:

Tuple

Represents an array of fixed length where the the item in the specified position is of the specified type.

Example:

['foo', 10] === [string, number] === Tuple<string, number>
Type:
any[]
Source:

YAMDBFOptions

Object containing required Client properties to be passed to a Client on construction

Type:
Object
Properties:
Name Type Attributes Default Description
token
string
<optional>

Token needed to connect the Client to Discord

owner
string[]
<optional>
[]

Can also be a single string
See: Client#owner

provider
string
<optional>

See: Client#provider

commandsDir
string
<optional>

See: Client#commandsDir

localeDir
string
<optional>

See: Client#localeDir

defaultLang
string
<optional>

See: Client#defaultLang

statusText
string
<optional>
null

See: Client#statusText

readyText
string
<optional>
'Client ready!'

See: Client#readyText

unknownCommandError
boolean
<optional>
true

See: Client#unknownCommandError

selfbot
boolean
<optional>
false

See: Client#selfbot

passive
boolean
<optional>
false

See: Client#passive

pause
boolean
<optional>
false

See: Client#pause

disableBase
string[]
<optional>
[]

See: Client#disableBase

ratelimit
string
<optional>

Sets a global rate limit on command calls for every user

logLevel
LogLevel
<optional>

Sets the logging level for the logger. Defaults to LogLevel.LOG

plugins
Array<(PluginConstructor|string)>
<optional>
[]

An array of Plugin classes (not instances) or plugin package name strings to be loaded and used

Source: