mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
feat: stage instances (#5749)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: SpaceEEC <spaceeec@yahoo.com> Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -15,6 +15,7 @@ const GuildEmojiManager = require('../managers/GuildEmojiManager');
|
||||
const GuildMemberManager = require('../managers/GuildMemberManager');
|
||||
const PresenceManager = require('../managers/PresenceManager');
|
||||
const RoleManager = require('../managers/RoleManager');
|
||||
const StageInstanceManager = require('../managers/StageInstanceManager');
|
||||
const VoiceStateManager = require('../managers/VoiceStateManager');
|
||||
const Collection = require('../util/Collection');
|
||||
const {
|
||||
@@ -83,6 +84,12 @@ class Guild extends BaseGuild {
|
||||
*/
|
||||
this.voiceStates = new VoiceStateManager(this);
|
||||
|
||||
/**
|
||||
* A manager of the stage instances of this guild
|
||||
* @type {StageInstanceManager}
|
||||
*/
|
||||
this.stageInstances = new StageInstanceManager(this);
|
||||
|
||||
/**
|
||||
* Whether the bot has been removed from the guild
|
||||
* @type {boolean}
|
||||
@@ -402,6 +409,13 @@ class Guild extends BaseGuild {
|
||||
}
|
||||
}
|
||||
|
||||
if (data.stage_instances) {
|
||||
this.stageInstances.cache.clear();
|
||||
for (const stageInstance of data.stage_instances) {
|
||||
this.stageInstances.add(stageInstance);
|
||||
}
|
||||
}
|
||||
|
||||
if (data.voice_states) {
|
||||
this.voiceStates.cache.clear();
|
||||
for (const voiceState of data.voice_states) {
|
||||
|
||||
Reference in New Issue
Block a user