mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
Gateway v6 support
This commit is contained in:
@@ -802,13 +802,13 @@ var Client = (function (_EventEmitter) {
|
|||||||
// def createChannel
|
// def createChannel
|
||||||
|
|
||||||
Client.prototype.createChannel = function createChannel(server, name) {
|
Client.prototype.createChannel = function createChannel(server, name) {
|
||||||
var type = arguments.length <= 2 || arguments[2] === undefined ? "text" : arguments[2];
|
var type = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
|
||||||
var callback = arguments.length <= 3 || arguments[3] === undefined ? function () /*err, channel*/{} : arguments[3];
|
var callback = arguments.length <= 3 || arguments[3] === undefined ? function () /*err, channel*/{} : arguments[3];
|
||||||
|
|
||||||
if (typeof type === "function") {
|
if (typeof type === "function") {
|
||||||
// options is the callback
|
// options is the callback
|
||||||
callback = type;
|
callback = type;
|
||||||
type = "text";
|
type = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.internal.createChannel(server, name, type).then(dataCallback(callback), errorCallback(callback));
|
return this.internal.createChannel(server, name, type).then(dataCallback(callback), errorCallback(callback));
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ var _UtilTokenCacher = require("../Util/TokenCacher");
|
|||||||
|
|
||||||
var _UtilTokenCacher2 = _interopRequireDefault(_UtilTokenCacher);
|
var _UtilTokenCacher2 = _interopRequireDefault(_UtilTokenCacher);
|
||||||
|
|
||||||
var GATEWAY_VERSION = 5;
|
var GATEWAY_VERSION = 6;
|
||||||
var zlib;
|
var zlib;
|
||||||
var libVersion = require('../../package.json').version;
|
var libVersion = require('../../package.json').version;
|
||||||
|
|
||||||
@@ -1082,7 +1082,7 @@ var InternalClient = (function () {
|
|||||||
InternalClient.prototype.createChannel = function createChannel(server, name) {
|
InternalClient.prototype.createChannel = function createChannel(server, name) {
|
||||||
var _this21 = this;
|
var _this21 = this;
|
||||||
|
|
||||||
var type = arguments.length <= 2 || arguments[2] === undefined ? "text" : arguments[2];
|
var type = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
|
||||||
|
|
||||||
server = this.resolver.resolveServer(server);
|
server = this.resolver.resolveServer(server);
|
||||||
|
|
||||||
@@ -1091,7 +1091,7 @@ var InternalClient = (function () {
|
|||||||
type: type
|
type: type
|
||||||
}).then(function (res) {
|
}).then(function (res) {
|
||||||
var channel;
|
var channel;
|
||||||
if (res.type === "text") {
|
if (res.type === 0) {
|
||||||
channel = new _StructuresTextChannel2["default"](res, _this21.client, server);
|
channel = new _StructuresTextChannel2["default"](res, _this21.client, server);
|
||||||
} else {
|
} else {
|
||||||
channel = new _StructuresVoiceChannel2["default"](res, _this21.client, server);
|
channel = new _StructuresVoiceChannel2["default"](res, _this21.client, server);
|
||||||
@@ -1908,7 +1908,6 @@ var InternalClient = (function () {
|
|||||||
_this36.identify();
|
_this36.identify();
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
console.log(packet);
|
|
||||||
if (_this36.sessionID) {
|
if (_this36.sessionID) {
|
||||||
_this36.resume();
|
_this36.resume();
|
||||||
} else {
|
} else {
|
||||||
@@ -2080,15 +2079,15 @@ var InternalClient = (function () {
|
|||||||
|
|
||||||
if (msg) {
|
if (msg) {
|
||||||
// old message exists
|
// old message exists
|
||||||
data.nonce = data.nonce || msg.nonce;
|
data.nonce = data.nonce !== undefined ? data.nonce : msg.nonce;
|
||||||
data.attachments = data.attachments || msg.attachments;
|
data.attachments = data.attachments !== undefined ? data.attachments : msg.attachments;
|
||||||
data.tts = data.tts || msg.tts;
|
data.tts = data.tts !== undefined ? data.tts : msg.tts;
|
||||||
data.embeds = data.embeds || msg.embeds;
|
data.embeds = data.embeds !== undefined ? data.embeds : msg.embeds;
|
||||||
data.timestamp = data.timestamp || msg.timestamp;
|
data.timestamp = data.timestamp !== undefined ? data.timestamp : msg.timestamp;
|
||||||
data.mention_everyone = data.mention_everyone || msg.everyoneMentioned;
|
data.mention_everyone = data.mention_everyone !== undefined ? data.mention_everyone : msg.everyoneMentioned;
|
||||||
data.content = data.content || msg.content;
|
data.content = data.content !== undefined ? data.content : msg.content;
|
||||||
data.mentions = data.mentions || msg.mentions;
|
data.mentions = data.mentions !== undefined ? data.mentions : msg.mentions;
|
||||||
data.author = data.author || msg.author;
|
data.author = data.author !== undefined ? data.author : msg.author;
|
||||||
msg = new _StructuresMessage2["default"](msg, channel, client);
|
msg = new _StructuresMessage2["default"](msg, channel, client);
|
||||||
} else if (!data.author || !data.content) {
|
} else if (!data.author || !data.content) {
|
||||||
break;
|
break;
|
||||||
@@ -2230,7 +2229,7 @@ var InternalClient = (function () {
|
|||||||
var server = this.servers.get("id", data.guild_id);
|
var server = this.servers.get("id", data.guild_id);
|
||||||
if (server) {
|
if (server) {
|
||||||
var chan = null;
|
var chan = null;
|
||||||
if (data.type === "text") {
|
if (data.type === 0) {
|
||||||
chan = this.channels.add(new _StructuresTextChannel2["default"](data, client, server));
|
chan = this.channels.add(new _StructuresTextChannel2["default"](data, client, server));
|
||||||
} else {
|
} else {
|
||||||
chan = this.channels.add(new _StructuresVoiceChannel2["default"](data, client, server));
|
chan = this.channels.add(new _StructuresVoiceChannel2["default"](data, client, server));
|
||||||
@@ -2272,7 +2271,7 @@ var InternalClient = (function () {
|
|||||||
client.emit("channelUpdated", new _StructuresPMChannel2["default"](channel, client), this.private_channels.update(channel, new _StructuresPMChannel2["default"](data, client)));
|
client.emit("channelUpdated", new _StructuresPMChannel2["default"](channel, client), this.private_channels.update(channel, new _StructuresPMChannel2["default"](data, client)));
|
||||||
} else {
|
} else {
|
||||||
if (channel.server) {
|
if (channel.server) {
|
||||||
if (channel.type === "text") {
|
if (channel.type === 0) {
|
||||||
//TEXT CHANNEL
|
//TEXT CHANNEL
|
||||||
var chan = new _StructuresTextChannel2["default"](data, client, channel.server);
|
var chan = new _StructuresTextChannel2["default"](data, client, channel.server);
|
||||||
chan.messages = channel.messages;
|
chan.messages = channel.messages;
|
||||||
|
|||||||
@@ -39,12 +39,14 @@ var Message = (function (_Equality) {
|
|||||||
_classCallCheck(this, Message);
|
_classCallCheck(this, Message);
|
||||||
|
|
||||||
_Equality.call(this);
|
_Equality.call(this);
|
||||||
|
this.type = data.type;
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
this.server = channel.server;
|
this.server = channel.server;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.nonce = data.nonce;
|
this.nonce = data.nonce;
|
||||||
this.attachments = data.attachments;
|
this.attachments = data.attachments;
|
||||||
this.tts = data.tts;
|
this.tts = data.tts;
|
||||||
|
this.pinned = data.pinned;
|
||||||
this.embeds = data.embeds;
|
this.embeds = data.embeds;
|
||||||
this.timestamp = Date.parse(data.timestamp);
|
this.timestamp = Date.parse(data.timestamp);
|
||||||
this.everyoneMentioned = data.mention_everyone !== undefined ? data.mention_everyone : data.everyoneMentioned;
|
this.everyoneMentioned = data.mention_everyone !== undefined ? data.mention_everyone : data.everyoneMentioned;
|
||||||
@@ -61,7 +63,25 @@ var Message = (function (_Equality) {
|
|||||||
this.author = client.internal.users.add(new _User2["default"](data.author, client));
|
this.author = client.internal.users.add(new _User2["default"](data.author, client));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.content = data.content;
|
if (this.type === 0) {
|
||||||
|
this.content = data.content;
|
||||||
|
} else if (this.type === 1) {
|
||||||
|
this.content = this.author.mention() + " added <@" + data.mentions[0].id + ">.";
|
||||||
|
} else if (this.type === 2) {
|
||||||
|
if (this.author.id === data.mentions[0].id) {
|
||||||
|
this.content = this.author.mention() + " left the group.";
|
||||||
|
} else {
|
||||||
|
this.content = this.author.mention() + " removed <@" + data.mentions[0].id + ">.";
|
||||||
|
}
|
||||||
|
} else if (this.type === 3) {
|
||||||
|
this.content = this.author.mention() + " started a call.";
|
||||||
|
} else if (this.type === 4) {
|
||||||
|
this.content = this.author.mention() + " changed the channel name: " + data.content;
|
||||||
|
} else if (this.type === 5) {
|
||||||
|
this.content = this.author.mention() + " changed the channel icon.";
|
||||||
|
} else if (this.type === 6) {
|
||||||
|
this.content = this.author.mention() + " pinned a message to this channel. See all the pins.";
|
||||||
|
}
|
||||||
|
|
||||||
var mentionData = client.internal.resolver.resolveMentions(data.content, channel);
|
var mentionData = client.internal.resolver.resolveMentions(data.content, channel);
|
||||||
this.cleanContent = mentionData[1];
|
this.cleanContent = mentionData[1];
|
||||||
|
|||||||
@@ -28,18 +28,28 @@ var PMChannel = (function (_Channel) {
|
|||||||
_inherits(PMChannel, _Channel);
|
_inherits(PMChannel, _Channel);
|
||||||
|
|
||||||
function PMChannel(data, client) {
|
function PMChannel(data, client) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
_classCallCheck(this, PMChannel);
|
_classCallCheck(this, PMChannel);
|
||||||
|
|
||||||
_Channel.call(this, data, client);
|
_Channel.call(this, data, client);
|
||||||
|
|
||||||
this.type = data.type || "text";
|
this.type = data.type;
|
||||||
this.lastMessageID = data.last_message_id || data.lastMessageID;
|
this.lastMessageID = data.last_message_id || data.lastMessageID;
|
||||||
this.messages = new _UtilCache2["default"]("id", client.options.maxCachedMessages);
|
this.messages = new _UtilCache2["default"]("id", client.options.maxCachedMessages);
|
||||||
this.recipient = this.client.internal.users.add(new _User2["default"](data.recipient, this.client));
|
if (data.recipients instanceof _UtilCache2["default"]) {
|
||||||
|
this.recipients = data.recipients;
|
||||||
|
} else {
|
||||||
|
this.recipients = new _UtilCache2["default"]();
|
||||||
|
data.recipients.forEach(function (recipient) {
|
||||||
|
_this.recipients.add(_this.client.internal.users.add(new _User2["default"](recipient, _this.client)));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.name = data.name !== undefined ? data.name : this.name;
|
||||||
|
this.owner = data.owner || this.client.internal.users.get("id", data.owner_id);
|
||||||
|
this.icon = data.icon !== undefined ? data.icon : this.icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* warning! may return null */
|
|
||||||
|
|
||||||
PMChannel.prototype.toString = function toString() {
|
PMChannel.prototype.toString = function toString() {
|
||||||
return this.recipient.toString();
|
return this.recipient.toString();
|
||||||
};
|
};
|
||||||
@@ -105,6 +115,13 @@ var PMChannel = (function (_Channel) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_createClass(PMChannel, [{
|
_createClass(PMChannel, [{
|
||||||
|
key: "recipient",
|
||||||
|
get: function get() {
|
||||||
|
return this.recipients[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* warning! may return null */
|
||||||
|
}, {
|
||||||
key: "lastMessage",
|
key: "lastMessage",
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return this.messages.get("id", this.lastMessageID);
|
return this.messages.get("id", this.lastMessageID);
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ var Server = (function (_Equality) {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
data.channels.forEach(function (dataChannel) {
|
data.channels.forEach(function (dataChannel) {
|
||||||
if (dataChannel.type === "text") {
|
if (dataChannel.type === 0) {
|
||||||
_this.channels.add(client.internal.channels.add(new _TextChannel2["default"](dataChannel, client, _this)));
|
_this.channels.add(client.internal.channels.add(new _TextChannel2["default"](dataChannel, client, _this)));
|
||||||
} else {
|
} else {
|
||||||
_this.channels.add(client.internal.channels.add(new _VoiceChannel2["default"](dataChannel, client, _this)));
|
_this.channels.add(client.internal.channels.add(new _VoiceChannel2["default"](dataChannel, client, _this)));
|
||||||
|
|||||||
@@ -877,11 +877,11 @@ export default class Client extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// def createChannel
|
// def createChannel
|
||||||
createChannel(server, name, type = "text", callback = (/*err, channel*/) => { }) {
|
createChannel(server, name, type = 0, callback = (/*err, channel*/) => { }) {
|
||||||
if (typeof type === "function") {
|
if (typeof type === "function") {
|
||||||
// options is the callback
|
// options is the callback
|
||||||
callback = type;
|
callback = type;
|
||||||
type = "text";
|
type = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.internal.createChannel(server, name, type)
|
return this.internal.createChannel(server, name, type)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import Invite from "../Structures/Invite";
|
|||||||
import VoiceConnection from "../Voice/VoiceConnection";
|
import VoiceConnection from "../Voice/VoiceConnection";
|
||||||
import TokenCacher from "../Util/TokenCacher";
|
import TokenCacher from "../Util/TokenCacher";
|
||||||
|
|
||||||
var GATEWAY_VERSION = 5;
|
var GATEWAY_VERSION = 6;
|
||||||
var zlib;
|
var zlib;
|
||||||
var libVersion = require('../../package.json').version;
|
var libVersion = require('../../package.json').version;
|
||||||
|
|
||||||
@@ -935,7 +935,7 @@ export default class InternalClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// def createChannel
|
// def createChannel
|
||||||
createChannel(server, name, type = "text") {
|
createChannel(server, name, type = 0) {
|
||||||
|
|
||||||
server = this.resolver.resolveServer(server);
|
server = this.resolver.resolveServer(server);
|
||||||
|
|
||||||
@@ -945,7 +945,7 @@ export default class InternalClient {
|
|||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
var channel;
|
var channel;
|
||||||
if (res.type === "text") {
|
if (res.type === 0) {
|
||||||
channel = new TextChannel(res, this.client, server);
|
channel = new TextChannel(res, this.client, server);
|
||||||
} else {
|
} else {
|
||||||
channel = new VoiceChannel(res, this.client, server);
|
channel = new VoiceChannel(res, this.client, server);
|
||||||
@@ -1679,7 +1679,6 @@ export default class InternalClient {
|
|||||||
this.identify();
|
this.identify();
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
console.log(packet);
|
|
||||||
if(this.sessionID) {
|
if(this.sessionID) {
|
||||||
this.resume();
|
this.resume();
|
||||||
} else {
|
} else {
|
||||||
@@ -1840,15 +1839,15 @@ export default class InternalClient {
|
|||||||
|
|
||||||
if (msg) {
|
if (msg) {
|
||||||
// old message exists
|
// old message exists
|
||||||
data.nonce = data.nonce || msg.nonce;
|
data.nonce = data.nonce !== undefined ? data.nonce : msg.nonce;
|
||||||
data.attachments = data.attachments || msg.attachments;
|
data.attachments = data.attachments !== undefined ? data.attachments : msg.attachments;
|
||||||
data.tts = data.tts || msg.tts;
|
data.tts = data.tts !== undefined ? data.tts : msg.tts;
|
||||||
data.embeds = data.embeds || msg.embeds;
|
data.embeds = data.embeds !== undefined ? data.embeds : msg.embeds;
|
||||||
data.timestamp = data.timestamp || msg.timestamp;
|
data.timestamp = data.timestamp !== undefined ? data.timestamp : msg.timestamp;
|
||||||
data.mention_everyone = data.mention_everyone || msg.everyoneMentioned;
|
data.mention_everyone = data.mention_everyone !== undefined ? data.mention_everyone : msg.everyoneMentioned;
|
||||||
data.content = data.content || msg.content;
|
data.content = data.content !== undefined ? data.content : msg.content;
|
||||||
data.mentions = data.mentions || msg.mentions;
|
data.mentions = data.mentions !== undefined ? data.mentions : msg.mentions;
|
||||||
data.author = data.author || msg.author;
|
data.author = data.author !== undefined ? data.author : msg.author;
|
||||||
msg = new Message(msg, channel, client);
|
msg = new Message(msg, channel, client);
|
||||||
} else if (!data.author || !data.content) {
|
} else if (!data.author || !data.content) {
|
||||||
break;
|
break;
|
||||||
@@ -1955,7 +1954,7 @@ export default class InternalClient {
|
|||||||
var server = this.servers.get("id", data.guild_id);
|
var server = this.servers.get("id", data.guild_id);
|
||||||
if (server) {
|
if (server) {
|
||||||
var chan = null;
|
var chan = null;
|
||||||
if (data.type === "text") {
|
if (data.type === 0) {
|
||||||
chan = this.channels.add(new TextChannel(data, client, server));
|
chan = this.channels.add(new TextChannel(data, client, server));
|
||||||
} else {
|
} else {
|
||||||
chan = this.channels.add(new VoiceChannel(data, client, server));
|
chan = this.channels.add(new VoiceChannel(data, client, server));
|
||||||
@@ -1999,7 +1998,7 @@ export default class InternalClient {
|
|||||||
this.private_channels.update(channel, new PMChannel(data, client)));
|
this.private_channels.update(channel, new PMChannel(data, client)));
|
||||||
} else {
|
} else {
|
||||||
if (channel.server) {
|
if (channel.server) {
|
||||||
if (channel.type === "text") {
|
if (channel.type === 0) {
|
||||||
//TEXT CHANNEL
|
//TEXT CHANNEL
|
||||||
var chan = new TextChannel(data, client, channel.server);
|
var chan = new TextChannel(data, client, channel.server);
|
||||||
chan.messages = channel.messages;
|
chan.messages = channel.messages;
|
||||||
|
|||||||
@@ -14,12 +14,14 @@ import Equality from "../Util/Equality";
|
|||||||
export default class Message extends Equality{
|
export default class Message extends Equality{
|
||||||
constructor(data, channel, client) {
|
constructor(data, channel, client) {
|
||||||
super();
|
super();
|
||||||
|
this.type = data.type;
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
this.server = channel.server;
|
this.server = channel.server;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.nonce = data.nonce;
|
this.nonce = data.nonce;
|
||||||
this.attachments = data.attachments;
|
this.attachments = data.attachments;
|
||||||
this.tts = data.tts;
|
this.tts = data.tts;
|
||||||
|
this.pinned = data.pinned;
|
||||||
this.embeds = data.embeds;
|
this.embeds = data.embeds;
|
||||||
this.timestamp = Date.parse(data.timestamp);
|
this.timestamp = Date.parse(data.timestamp);
|
||||||
this.everyoneMentioned = data.mention_everyone !== undefined ? data.mention_everyone : data.everyoneMentioned;
|
this.everyoneMentioned = data.mention_everyone !== undefined ? data.mention_everyone : data.everyoneMentioned;
|
||||||
@@ -36,7 +38,25 @@ export default class Message extends Equality{
|
|||||||
this.author = client.internal.users.add(new User(data.author, client));
|
this.author = client.internal.users.add(new User(data.author, client));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.content = data.content;
|
if(this.type === 0) {
|
||||||
|
this.content = data.content;
|
||||||
|
} else if(this.type === 1) {
|
||||||
|
this.content = this.author.mention() + " added <@" + data.mentions[0].id + ">.";
|
||||||
|
} else if(this.type === 2) {
|
||||||
|
if(this.author.id === data.mentions[0].id) {
|
||||||
|
this.content = this.author.mention() + " left the group.";
|
||||||
|
} else {
|
||||||
|
this.content = this.author.mention() + " removed <@" + data.mentions[0].id + ">.";
|
||||||
|
}
|
||||||
|
} else if(this.type === 3) {
|
||||||
|
this.content = this.author.mention() + " started a call.";
|
||||||
|
} else if(this.type === 4) {
|
||||||
|
this.content = this.author.mention() + " changed the channel name: " + data.content;
|
||||||
|
} else if(this.type === 5) {
|
||||||
|
this.content = this.author.mention() + " changed the channel icon.";
|
||||||
|
} else if(this.type === 6) {
|
||||||
|
this.content = this.author.mention() + " pinned a message to this channel. See all the pins.";
|
||||||
|
}
|
||||||
|
|
||||||
var mentionData = client.internal.resolver.resolveMentions(data.content, channel);
|
var mentionData = client.internal.resolver.resolveMentions(data.content, channel);
|
||||||
this.cleanContent = mentionData[1];
|
this.cleanContent = mentionData[1];
|
||||||
|
|||||||
@@ -9,10 +9,24 @@ export default class PMChannel extends Channel {
|
|||||||
constructor(data, client){
|
constructor(data, client){
|
||||||
super(data, client);
|
super(data, client);
|
||||||
|
|
||||||
this.type = data.type || "text";
|
this.type = data.type;
|
||||||
this.lastMessageID = data.last_message_id || data.lastMessageID;
|
this.lastMessageID = data.last_message_id || data.lastMessageID;
|
||||||
this.messages = new Cache("id", client.options.maxCachedMessages);
|
this.messages = new Cache("id", client.options.maxCachedMessages);
|
||||||
this.recipient = this.client.internal.users.add(new User(data.recipient, this.client));
|
if(data.recipients instanceof Cache) {
|
||||||
|
this.recipients = data.recipients;
|
||||||
|
} else {
|
||||||
|
this.recipients = new Cache();
|
||||||
|
data.recipients.forEach((recipient) => {
|
||||||
|
this.recipients.add(this.client.internal.users.add(new User(recipient, this.client)));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.name = data.name !== undefined ? data.name : this.name;
|
||||||
|
this.owner = data.owner || this.client.internal.users.get("id", data.owner_id);
|
||||||
|
this.icon = data.icon !== undefined ? data.icon : this.icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
get recipient() {
|
||||||
|
return this.recipients[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* warning! may return null */
|
/* warning! may return null */
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export default class Server extends Equality {
|
|||||||
data.channels.forEach((channel) => this.channels.add(channel));
|
data.channels.forEach((channel) => this.channels.add(channel));
|
||||||
} else {
|
} else {
|
||||||
data.channels.forEach((dataChannel) => {
|
data.channels.forEach((dataChannel) => {
|
||||||
if (dataChannel.type === "text") {
|
if (dataChannel.type === 0) {
|
||||||
this.channels.add(client.internal.channels.add(new TextChannel(dataChannel, client, this)));
|
this.channels.add(client.internal.channels.add(new TextChannel(dataChannel, client, this)));
|
||||||
} else {
|
} else {
|
||||||
this.channels.add(client.internal.channels.add(new VoiceChannel(dataChannel, client, this)));
|
this.channels.add(client.internal.channels.add(new VoiceChannel(dataChannel, client, this)));
|
||||||
|
|||||||
Reference in New Issue
Block a user