mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
feat: add support for GuildScheduledEvent (#6493)
Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com> Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com> Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: GoldenAngel <50855202+GoldenAngel2@users.noreply.github.com> Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: Antonio Román <kyradiscord@gmail.com> Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
@@ -15,6 +15,7 @@ const GuildChannelManager = require('../managers/GuildChannelManager');
|
||||
const GuildEmojiManager = require('../managers/GuildEmojiManager');
|
||||
const GuildInviteManager = require('../managers/GuildInviteManager');
|
||||
const GuildMemberManager = require('../managers/GuildMemberManager');
|
||||
const GuildScheduledEventManager = require('../managers/GuildScheduledEventManager');
|
||||
const GuildStickerManager = require('../managers/GuildStickerManager');
|
||||
const PresenceManager = require('../managers/PresenceManager');
|
||||
const RoleManager = require('../managers/RoleManager');
|
||||
@@ -109,6 +110,12 @@ class Guild extends AnonymousGuild {
|
||||
*/
|
||||
this.invites = new GuildInviteManager(this);
|
||||
|
||||
/**
|
||||
* A manager of the scheduled events of this guild
|
||||
* @type {GuildScheduledEventManager}
|
||||
*/
|
||||
this.scheduledEvents = new GuildScheduledEventManager(this);
|
||||
|
||||
if (!data) return;
|
||||
if (data.unavailable) {
|
||||
/**
|
||||
@@ -461,6 +468,13 @@ class Guild extends AnonymousGuild {
|
||||
}
|
||||
}
|
||||
|
||||
if (data.guild_scheduled_events) {
|
||||
this.scheduledEvents.cache.clear();
|
||||
for (const scheduledEvent of data.guild_scheduled_events) {
|
||||
this.scheduledEvents._add(scheduledEvent);
|
||||
}
|
||||
}
|
||||
|
||||
if (data.voice_states) {
|
||||
this.voiceStates.cache.clear();
|
||||
for (const voiceState of data.voice_states) {
|
||||
|
||||
Reference in New Issue
Block a user