Constructor
new Shard()
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
id |
Number
|
The ID of the shard |
|
connecting |
Boolean
|
Whether the shard is connecting |
|
discordServerTrace |
Array.<String>
|
<nullable> |
Debug trace of Discord servers |
lastHeartbeatReceived |
Number
|
Last time Discord acknowledged a heartbeat, null if shard has not sent heartbeat yet |
|
lastHeartbeatSent |
Number
|
Last time shard sent a heartbeat, null if shard has not sent heartbeat yet |
|
latency |
Number
|
The current latency between the shard and Discord, in milliseconds |
|
ready |
Boolean
|
Whether the shard is ready |
|
status |
String
|
The status of the shard. "disconnected"/"connecting"/"handshaking"/"ready"/"identifying"/"resuming" |
- Source:
Extends
- EventEmitter
Methods
disconnect(optionsopt, nullable, erroropt)
Disconnects the shard
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> <nullable> |
Shard disconnect options
|
||||||||
error |
Error
|
<optional> |
The error that causes the disconnect |
editAFK(afk)
Update the bot's AFK status.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
afk |
Boolean
|
Whether the bot user is AFK or not |
editStatus(statusopt, activitiesopt)
Updates the bot's status on all guilds the shard is in
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
status |
String
|
<optional> |
Sets the bot's status, either "online", "idle", "dnd", or "invisible" |
||||||||||||||||||||
activities |
Array
|
Object
|
<optional> |
Sets the bot's activities. A single activity object is also accepted for backwards compatibility
|
Events
disconnect
Fired when the shard disconnects
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
err |
Error
|
<nullable> |
The error, if any |
- Source: