mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
refactor: new node features (#5132)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -29,7 +29,7 @@ class Channel extends Base {
|
||||
* * `unknown` - a generic channel of unknown type, could be Channel or GuildChannel
|
||||
* @type {string}
|
||||
*/
|
||||
this.type = type ? type.toLowerCase() : 'unknown';
|
||||
this.type = type?.toLowerCase() ?? 'unknown';
|
||||
|
||||
/**
|
||||
* Whether the channel has been deleted
|
||||
@@ -130,7 +130,8 @@ class Channel extends Base {
|
||||
channel = new PartialGroupDMChannel(client, data);
|
||||
}
|
||||
} else {
|
||||
guild = guild || client.guilds.cache.get(data.guild_id);
|
||||
if (!guild) guild = client.guilds.cache.get(data.guild_id);
|
||||
|
||||
if (guild) {
|
||||
switch (data.type) {
|
||||
case ChannelTypes.TEXT: {
|
||||
|
||||
Reference in New Issue
Block a user