Skip to content

Commit

Permalink
chore: properly serialize forum channel
Browse files Browse the repository at this point in the history
  • Loading branch information
suneettipirneni committed Jun 1, 2022
1 parent 38f345e commit b1baf52
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/discord.js/src/structures/Channel.js
Expand Up @@ -12,6 +12,7 @@ let TextChannel;
let ThreadChannel;
let VoiceChannel;
let DirectoryChannel;
let GuildForumChannel;

/**
* Represents any channel on Discord.
Expand Down Expand Up @@ -215,6 +216,7 @@ class Channel extends Base {
ThreadChannel ??= require('./ThreadChannel');
VoiceChannel ??= require('./VoiceChannel');
DirectoryChannel ??= require('./DirectoryChannel');
GuildForumChannel ??= require('./GuildForumChannel');

let channel;
if (!data.guild_id && !guild) {
Expand Down Expand Up @@ -259,6 +261,10 @@ class Channel extends Base {
case ChannelType.GuildDirectory:
channel = new DirectoryChannel(client, data);
break;
case ChannelType.GuildForum: {
channel = new GuildForumChannel(guild, data, client);
break;
}
}
if (channel && !allowUnknownGuild) guild.channels?.cache.set(channel.id, channel);
}
Expand Down

0 comments on commit b1baf52

Please sign in to comment.