Constructor
new Shard()
- Source:
Properties:
Name | Type | Description |
---|---|---|
id |
String | The id of the Shard |
guilds |
Store | A store of guilds of each Shard |
ms |
Number | The uptime of a shard in ms |
latency |
Number | The API Latency of the Shard in ms |
Methods
connect() → {Boolean}
- Source:
Connects the shard
Returns:
Whether the connect was from a reconnect
- Type
- Boolean
disconnect(reconnectopt) → {Shard}
- Source:
Disconnect/Reconnects a shard
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
reconnect |
Boolean |
<optional> |
false
|
Whether or not to reconnect |
Returns:
- Type
- Shard
fetchAllMembers()
- Source:
Sends an Opcode 8 ( Request Guild Members ) to discord
identify()
- Source:
Sends the identify payload to discord for logging in
initiate() → {Shard}
- Source:
Initiate the shard
Returns:
- Type
- Shard
listen_event(packet) → {Object.<Packet>}
- Source:
Listens for Discord events from the Websocket
Parameters:
Name | Type | Description |
---|---|---|
packet |
Object | The packet received from discord |
Returns:
- Type
- Object.<Packet>
listen_message(packet) → {Object.<Packet>}
- Source:
Listens for messages from the Websocket
Parameters:
Name | Type | Description |
---|---|---|
packet |
Object | The packet received from discord |
Returns:
- Type
- Object.<Packet>
resume()
- Source:
Sends an Opcode 6 ( Resume ) to Discord
send(data) → {Data}
- Source:
Sends data to the websocket
Parameters:
Name | Type | Description |
---|---|---|
data |
Any | The data to send |
Returns:
- Type
- Data
setActivity(optionsopt) → {Object}
- Source:
Sends an activity to the shard
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
The options for the Activity Properties
|
Returns:
The options for the Activity
- Type
- Object
setup() → {Shard}
- Source:
Setup some properties for the Shard
Returns:
- Type
- Shard