Client

Client

A client user, which is able to handle multiple shards.

Constructor

new Client(optionsnullable)

Description:
  • Creates the client and sets the default options.

Source:
Parameters:
Name Type Attributes Description
options Object <nullable>

The options to pass to the client.

Properties
Name Type Attributes Description
cacheMessages Boolean <nullable>

Whether to cache messages.

cacheUsers Boolean <nullable>

Whether to cache users.

cacheMembers Boolean <nullable>

Whether to cache members.

cacheChannels Boolean <nullable>

Whether to cache channels.

cacheGuilds Boolean <nullable>

Whether to cache guilds.

cacheVoiceStates Boolean <nullable>

Whether to cache voice states.

cacheRoles Boolean <nullable>

Whether to cache roles.

cacheScheduledEvents Boolean <nullable>

Whether to cache scheduled events.

cacheEmojis Boolean <nullable>

Whether to cache emojis.

cacheInvites Boolean <nullable>

Whether to cache invites.

defaultMessageExpiry Number <nullable>

The default expiry time for messages.

defaultUserExpiry Number <nullable>

The default expiry time for users.

intents Number

The intents to use when connecting.

totalShards Number <nullable>

The total number of shards to manage.

shardIds Array.<Number> <nullable>

The ids of the shards to manage.

sessionData Object <nullable>

The session data for the client.

initCache Object <nullable>

The initial cache data for the client.

softRestartFunction function <nullable>

The function to call when a soft restart is needed.

Throws:
TypeError

Members

(static) Client :UserManager

Description:
  • The user manager for this client.

Source:

The user manager for this client.

Type:

(static) Client :GuildManager

Description:
  • The guild manager for this client.

Source:

The guild manager for this client.

Type:

(readonly) _cacheOptions :GluonCacheOptions

Description:
  • Returns the cache options for this client.

Source:

Returns the cache options for this client.

Type:

(readonly) _defaultGuildCacheOptions :GuildCacheOptions

Description:
  • Returns the global guild cache options for this client.

Source:

Returns the global guild cache options for this client.

Type:

(readonly) guilds :GuildManager

Description:
  • The guild manager for this client.

Source:

The guild manager for this client.

Type:

(readonly) intents :Number

Description:
  • The intents that this client is using.

Source:

The intents that this client is using.

Type:
  • Number

(readonly) shardIds :Array.<Number>

Description:
  • The ids of the shards that this client is managing.

Source:

The ids of the shards that this client is managing.

Type:
  • Array.<Number>

(readonly) totalShards :Number

Description:
  • The total number of shards that this client is managing.

Source:

The total number of shards that this client is managing.

Type:
  • Number

(nullable) user :User

Description:
  • The client user.

Source:

The client user.

Type:

(readonly) users :UserManager

Description:
  • The user manager for this client.

Source:

The user manager for this client.

Type:

Methods

_emitDebug(status, message) → {void}

Description:
  • Outputs a debug message if NODE_ENV=development.

Source:
Parameters:
Name Type Description
status Number

The debug status level.

message String

The message to emit.

Returns:
Type
void

bundleCache() → {Array.<Object>}

Description:
  • Bundles all guilds.

Source:
Returns:
Type
Array.<Object>

checkProcess() → {Object}

Description:
  • Monitors the current process.

Source:
Returns:
Type
Object

getCacheCounts() → {Object}

Description:
  • Counts how many items are in each cache.

Source:
Returns:
Type
Object

getMemberCount() → {Number}

Description:
  • Counts how many members are in all of Quark's servers.

Source:
Returns:
Type
Number

halt() → {void}

Description:
  • Stops all shards.

Source:
Returns:
Type
void

login(token) → {void}

Description:
  • Initiates the login sequence

Source:
Parameters:
Name Type Description
token String

The authorization token

Throws:
TypeError
Returns:
Type
void

(async) registerCommands(commands) → {Array.<Object>}

Description:
  • Registers commands, overwriting all previous ones.

Source:
See:
Parameters:
Name Type Description
commands Array.<Command>

Array of commands to register.

Throws:
TypeError
Returns:
Type
Array.<Object>

setStatus(status) → {void}

Description:
  • Sets the bot's status across all shards.

Source:
Parameters:
Name Type Description
status Object

Status options.

Properties
Name Type Description
name String

The bot's new status.

type Number

The type of status.

status String

The bot's status.

afk Boolean

Whether the bot is afk.

since Number

The time since the bot has been afk.

Throws:
TypeError
Returns:
Type
void

softRestartFunction() → {void}

Description:
  • The function to call when a soft restart is needed.

Source:
Returns:
Type
void