fix 🐛 Channel cache error #625

💀
This commit is contained in:
Elysia 2023-04-20 18:18:01 +07:00
parent f0f22f8cab
commit 709b138610
3 changed files with 13 additions and 3 deletions

View File

@ -3,6 +3,7 @@
const { Collection } = require('@discordjs/collection'); const { Collection } = require('@discordjs/collection');
const GuildChannel = require('./GuildChannel'); const GuildChannel = require('./GuildChannel');
const TextBasedChannel = require('./interfaces/TextBasedChannel'); const TextBasedChannel = require('./interfaces/TextBasedChannel');
const InteractionManager = require('../managers/InteractionManager');
const MessageManager = require('../managers/MessageManager'); const MessageManager = require('../managers/MessageManager');
const { VideoQualityModes } = require('../util/Constants'); const { VideoQualityModes } = require('../util/Constants');
const Permissions = require('../util/Permissions'); const Permissions = require('../util/Permissions');
@ -26,6 +27,14 @@ class BaseGuildVoiceChannel extends GuildChannel {
* @type {boolean} * @type {boolean}
*/ */
this.nsfw = Boolean(data.nsfw); this.nsfw = Boolean(data.nsfw);
/**
* A manager of the interactions sent to this channel
* @type {InteractionManager}
*/
this.interactions = new InteractionManager(this);
this._patch(data);
} }
_patch(data) { _patch(data) {

View File

@ -15,7 +15,6 @@ let ForumChannel;
const ChannelFlags = require('../util/ChannelFlags'); const ChannelFlags = require('../util/ChannelFlags');
const { ChannelTypes, ThreadChannelTypes, VoiceBasedChannelTypes } = require('../util/Constants'); const { ChannelTypes, ThreadChannelTypes, VoiceBasedChannelTypes } = require('../util/Constants');
const SnowflakeUtil = require('../util/SnowflakeUtil'); const SnowflakeUtil = require('../util/SnowflakeUtil');
// Const { ApplicationCommand } = require('discord.js-selfbot-v13'); - Not being used in this file, not necessary.
/** /**
* @type {WeakSet<Channel>} * @type {WeakSet<Channel>}
@ -243,9 +242,11 @@ class Channel extends Base {
if (!allowUnknownGuild) channel.parent?.threads.cache.set(channel.id, channel); if (!allowUnknownGuild) channel.parent?.threads.cache.set(channel.id, channel);
break; break;
} }
case ChannelTypes.GUILD_DIRECTORY: case ChannelTypes.GUILD_DIRECTORY:
channel = new DirectoryChannel(client, data); channel = new DirectoryChannel(client, data);
break; break;
case ChannelTypes.GUILD_FORUM: case ChannelTypes.GUILD_FORUM:
channel = new ForumChannel(guild, data, client); channel = new ForumChannel(guild, data, client);
break; break;

View File

@ -201,8 +201,8 @@ class Options extends null {
os_version: '10.0.22621', os_version: '10.0.22621',
os_arch: 'x64', os_arch: 'x64',
system_locale: 'en-US', system_locale: 'en-US',
client_build_number: 189005, client_build_number: 190187,
native_build_number: 30921, native_build_number: 31718,
client_event_source: null, client_event_source: null,
design_id: 0, design_id: 0,
}, },