mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Move channel type to constructors
This commit is contained in:
@@ -11,6 +11,7 @@ const Collection = require('../util/Collection');
|
||||
class DMChannel extends Channel {
|
||||
constructor(client, data) {
|
||||
super(client, data);
|
||||
this.type = 'dm';
|
||||
this.messages = new Collection();
|
||||
this._typing = new Map();
|
||||
}
|
||||
@@ -24,7 +25,6 @@ class DMChannel extends Channel {
|
||||
*/
|
||||
this.recipient = this.client.dataManager.newUser(data.recipients[0]);
|
||||
|
||||
this.type = 'dm';
|
||||
this.lastMessageID = data.last_message_id;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ const arraysEqual = require('../util/ArraysEqual');
|
||||
class GroupDMChannel extends Channel {
|
||||
constructor(client, data) {
|
||||
super(client, data);
|
||||
this.type = 'group';
|
||||
this.messages = new Collection();
|
||||
this._typing = new Map();
|
||||
}
|
||||
@@ -73,7 +74,6 @@ class GroupDMChannel extends Channel {
|
||||
}
|
||||
}
|
||||
|
||||
this.type = 'group';
|
||||
this.lastMessageID = data.last_message_id;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ const Collection = require('../util/Collection');
|
||||
class TextChannel extends GuildChannel {
|
||||
constructor(guild, data) {
|
||||
super(guild, data);
|
||||
this.type = 'text';
|
||||
this.messages = new Collection();
|
||||
this._typing = new Map();
|
||||
}
|
||||
@@ -23,7 +24,6 @@ class TextChannel extends GuildChannel {
|
||||
*/
|
||||
this.topic = data.topic;
|
||||
|
||||
this.type = 'text';
|
||||
this.lastMessageID = data.last_message_id;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ class VoiceChannel extends GuildChannel {
|
||||
* @type {Collection<string, GuildMember>}
|
||||
*/
|
||||
this.members = new Collection();
|
||||
|
||||
this.type = 'voice';
|
||||
}
|
||||
|
||||
setup(data) {
|
||||
@@ -30,8 +32,6 @@ class VoiceChannel extends GuildChannel {
|
||||
* @type {number}
|
||||
*/
|
||||
this.userLimit = data.user_limit;
|
||||
|
||||
this.type = 'voice';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user