mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
refactor: ES2021 features (#6540)
Co-authored-by: Antonio Román <kyradiscord@gmail.com> Co-authored-by: Voltrex <mohammadkeyvanzade94@gmail.com>
This commit is contained in:
@@ -133,14 +133,14 @@ class Channel extends Base {
|
||||
}
|
||||
|
||||
static create(client, data, guild, { allowUnknownGuild, fromInteraction } = {}) {
|
||||
if (!CategoryChannel) CategoryChannel = require('./CategoryChannel');
|
||||
if (!DMChannel) DMChannel = require('./DMChannel');
|
||||
if (!NewsChannel) NewsChannel = require('./NewsChannel');
|
||||
if (!StageChannel) StageChannel = require('./StageChannel');
|
||||
if (!StoreChannel) StoreChannel = require('./StoreChannel');
|
||||
if (!TextChannel) TextChannel = require('./TextChannel');
|
||||
if (!ThreadChannel) ThreadChannel = require('./ThreadChannel');
|
||||
if (!VoiceChannel) VoiceChannel = require('./VoiceChannel');
|
||||
CategoryChannel ??= require('./CategoryChannel');
|
||||
DMChannel ??= require('./DMChannel');
|
||||
NewsChannel ??= require('./NewsChannel');
|
||||
StageChannel ??= require('./StageChannel');
|
||||
StoreChannel ??= require('./StoreChannel');
|
||||
TextChannel ??= require('./TextChannel');
|
||||
ThreadChannel ??= require('./ThreadChannel');
|
||||
VoiceChannel ??= require('./VoiceChannel');
|
||||
|
||||
let channel;
|
||||
if (!data.guild_id && !guild) {
|
||||
@@ -151,7 +151,7 @@ class Channel extends Base {
|
||||
channel = new PartialGroupDMChannel(client, data);
|
||||
}
|
||||
} else {
|
||||
if (!guild) guild = client.guilds.cache.get(data.guild_id);
|
||||
guild ??= client.guilds.cache.get(data.guild_id);
|
||||
|
||||
if (guild || allowUnknownGuild) {
|
||||
switch (data.type) {
|
||||
|
||||
Reference in New Issue
Block a user