mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
add guild sharding support (#393)
* add guild sharding support * squash if statements
This commit is contained in:
committed by
abalabahaha
parent
a073010197
commit
00e3708e78
@@ -1649,8 +1649,7 @@ var InternalClient = (function () {
|
||||
this.websocket = new _ws2["default"](url);
|
||||
|
||||
this.websocket.onopen = function () {
|
||||
|
||||
self.sendWS({
|
||||
var data = {
|
||||
op: 2,
|
||||
d: {
|
||||
token: self.token,
|
||||
@@ -1665,7 +1664,13 @@ var InternalClient = (function () {
|
||||
"$referring_domain": "discord.js"
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (self.client.options.shard) {
|
||||
data.d.shard = self.client.options.shard;
|
||||
}
|
||||
|
||||
self.sendWS(data);
|
||||
};
|
||||
|
||||
this.websocket.onclose = function (code) {
|
||||
|
||||
Reference in New Issue
Block a user