Create a client.
The bot's token.
A callback to be used for logging events internally throughout the client.
Optional
logThisArg: anyA value to use as this
in the logCallback
.
Readonly
DISTYPE_The version of Distype being used.
The client's cache.
The client's gateway manager.
The log callback used by the client.
Readonly
optionsOptions for the client. Note that any options not specified are set to a default value.
The client's rest manager.
Readonly
systemThe system string used for logging.
Tries to ensure channel data. Fetches data from the cache, then if data isn't found a rest request is made.
The channel's ID.
Rest
...keys: TProperties to ensure.
Tries to ensure guild data. Fetches data from the cache, then if data isn't found a rest request is made.
The guild's ID.
Rest
...keys: TProperties to ensure.
Tries to ensure member data. Fetches data from the cache, then if data isn't found a rest request is made.
The member's guild ID.
The member's user ID.
Rest
...keys: TProperties to ensure.
Tries to ensure presence data.
The presence's guild ID.
The presence's user ID.
Rest
...keys: TProperties to ensure.
Tries to ensure role data. Fetches data from the cache, then if data isn't found a rest request is made.
The role's ID.
The role's guild's ID.
Rest
...keys: TProperties to ensure.
Gets the bot's self permissions. For no requests to the API to be made, the following must be cached:
const cacheOptions = {
channels: [`permission_overwrites`], // Only necessary if channelId is specified
guilds: [`owner_id`, `roles`],
members: [`communication_disabled_until`, `roles`],
roles: [`permissions`]
}
The guild to get the bot's permissions in.
Optional
channelId: stringThe channel to get the bot's permissions in.
The bot's permission flags.
Tries to ensure user data. Fetches data from the cache, then if data isn't found a rest request is made.
The user's ID.
Rest
...keys: TProperties to ensure.
Tries to ensure presence data.
The presence's guild ID.
The presence's user ID.
Rest
...keys: TProperties to ensure.
Generated using TypeDoc
The Discord client.