mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
Capitalize channel type constants (#1209)
This commit is contained in:
@@ -50,15 +50,15 @@ class ClientDataManager {
|
|||||||
let channel;
|
let channel;
|
||||||
if (data.type === Constants.ChannelTypes.DM) {
|
if (data.type === Constants.ChannelTypes.DM) {
|
||||||
channel = new DMChannel(this.client, data);
|
channel = new DMChannel(this.client, data);
|
||||||
} else if (data.type === Constants.ChannelTypes.groupDM) {
|
} else if (data.type === Constants.ChannelTypes.GROUP_DM) {
|
||||||
channel = new GroupDMChannel(this.client, data);
|
channel = new GroupDMChannel(this.client, data);
|
||||||
} else {
|
} else {
|
||||||
guild = guild || this.client.guilds.get(data.guild_id);
|
guild = guild || this.client.guilds.get(data.guild_id);
|
||||||
if (guild) {
|
if (guild) {
|
||||||
if (data.type === Constants.ChannelTypes.text) {
|
if (data.type === Constants.ChannelTypes.TEXT) {
|
||||||
channel = new TextChannel(guild, data);
|
channel = new TextChannel(guild, data);
|
||||||
guild.channels.set(channel.id, channel);
|
guild.channels.set(channel.id, channel);
|
||||||
} else if (data.type === Constants.ChannelTypes.voice) {
|
} else if (data.type === Constants.ChannelTypes.VOICE) {
|
||||||
channel = new VoiceChannel(guild, data);
|
channel = new VoiceChannel(guild, data);
|
||||||
guild.channels.set(channel.id, channel);
|
guild.channels.set(channel.id, channel);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class PartialGuildChannel {
|
|||||||
* The type of this guild channel - `text` or `voice`
|
* The type of this guild channel - `text` or `voice`
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
this.type = Constants.ChannelTypes.text === data.type ? 'text' : 'voice';
|
this.type = Constants.ChannelTypes.TEXT === data.type ? 'text' : 'voice';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -175,10 +175,10 @@ exports.Status = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.ChannelTypes = {
|
exports.ChannelTypes = {
|
||||||
text: 0,
|
TEXT: 0,
|
||||||
DM: 1,
|
DM: 1,
|
||||||
voice: 2,
|
VOICE: 2,
|
||||||
groupDM: 3,
|
GROUP_DM: 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.OPCodes = {
|
exports.OPCodes = {
|
||||||
|
|||||||
Reference in New Issue
Block a user