Decorators
deprecated(message?: string) → MethodDecorator
Logs a deprecation warning for the decorated class method whenever it is called
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
|
<optional> |
Method deprecation message |
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()
Type Definitions
ArgOpts
Object containing options for controlling how command arguments will be parsed
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
separator |
|
<optional> |
' '
|
The charactor to separate args by |
- Source:
BaseStrings
Enum containing all base framework localization string keys
CommandInfo
Object containing required Command
properties
to be passed to a Command on construction
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
|
See: |
||
desc |
|
See: |
||
usage |
|
See: |
||
info |
|
<optional> |
See: |
|
group |
|
<optional> |
'base'
|
See: |
aliases |
|
<optional> |
[]
|
See: |
guildOnly |
|
<optional> |
false
|
See: |
hidden |
|
<optional> |
false
|
See: |
argOpts |
|
<optional> |
See: |
|
callerPermissions |
|
<optional> |
[]
|
|
clientPermissions |
|
<optional> |
[]
|
|
roles |
|
<optional> |
[]
|
See: |
ownerOnly |
|
<optional> |
false
|
See: |
overloads |
|
<optional> |
null
|
See: |
ratelimit |
|
<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
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
prefix |
|
'/'
|
Prefix denoting a command call |
|
disabledGroups |
|
<optional> |
[]
|
Command groups to ignore |
Difference
Represents a difference between two given valid Unix time signatures
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
ms |
|
<nullable> |
Total number of MS difference |
days |
|
<nullable> |
Number of days spanned |
hours |
|
<nullable> |
Number of hours spanned after higher units are subtracted |
minutes |
|
<nullable> |
Number of minutes spanned after higher units are subtracted |
secs |
|
<nullable> |
Number of seconds spanned after higher units are subtracted |
toString() |
|
Returns duration formatted as |
|
toSimplifiedString() |
|
Returns duration formatted as |
- 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
- Source:
LocalizedCommandInfo
Represents an object
containing localization overrides for a command's desc
,
info
, and usage
fields
LogData
Represents an object passed from Logger
to any TransportFunction
s given to it
Properties:
Name | Type | Description |
---|---|---|
timestamp |
|
Holds the time/date for this log |
type |
|
The log type. Will be one of:
|
tag |
|
The tag given for this log |
text |
|
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
}
- 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
PluginConstructor
Any class that extends and
implements Plugin
. Not to be confused with an instance
of a Plugin.
ResolveArgType
Valid arg type values for
resolve
. Can be one of
the following string literals:
'String' | 'Number' | 'Duration' | 'User' | 'Member' | 'BannedUser' | 'Channel' | 'Role'
- 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.
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()
- Source:
Transport
Represents a transport object for
the Logger
.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
transport |
|
The transport function to use for this transport |
|
level |
|
<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 |
|
The data received from the logger |
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>
- Source:
YAMDBFOptions
Object containing required Client
properties to be
passed to a Client on construction
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
token |
|
<optional> |
Token needed to connect the Client to Discord |
|
owner |
|
<optional> |
[]
|
Can also be a single string |
provider |
|
<optional> |
See: |
|
commandsDir |
|
<optional> |
See: |
|
localeDir |
|
<optional> |
See: |
|
defaultLang |
|
<optional> |
See: |
|
statusText |
|
<optional> |
null
|
See: |
readyText |
|
<optional> |
'Client ready!'
|
See: |
unknownCommandError |
|
<optional> |
true
|
|
selfbot |
|
<optional> |
false
|
See: |
passive |
|
<optional> |
false
|
See: |
pause |
|
<optional> |
false
|
See: |
disableBase |
|
<optional> |
[]
|
See: |
ratelimit |
|
<optional> |
Sets a global rate limit on command calls for every user |
|
logLevel |
|
<optional> |
Sets the logging level for the logger. Defaults to |
|
plugins |
|
<optional> |
[]
|
An array of Plugin classes (not instances) or plugin package name strings to be loaded and used |
- Source: