diff --git a/src/structures/ClientUser.js b/src/structures/ClientUser.js index 8852fc439..aa7c8edb0 100644 --- a/src/structures/ClientUser.js +++ b/src/structures/ClientUser.js @@ -88,6 +88,7 @@ class ClientUser extends User { this.guildSettings = new Collection(); if (data.user_guild_settings) { for (const settings of data.user_guild_settings) { + settings.client = this.client; const guild = this.client.guilds.get(settings.guild_id); this.guildSettings.set(settings.guild_id, new ClientUserGuildSettings(settings, guild)); } diff --git a/src/structures/ClientUserGuildSettings.js b/src/structures/ClientUserGuildSettings.js index 7bc336558..75d2f8332 100644 --- a/src/structures/ClientUserGuildSettings.js +++ b/src/structures/ClientUserGuildSettings.js @@ -8,6 +8,7 @@ const ClientUserChannelOverride = require('./ClientUserChannelOverride'); class ClientUserGuildSettings { constructor(data, guild) { this.guild = guild; + this.client = data.client; this.channelOverrides = new Collection(); this.patch(data); } @@ -23,7 +24,7 @@ class ClientUserGuildSettings { if (key === 'channel_overrides') { for (const channel of data[key]) { this.channelOverrides.set(channel.channel_id, - new ClientUserChannelOverride(this.guild.client.user, channel)); + new ClientUserChannelOverride(this.client.user, channel)); } } else if (typeof value === 'function') { this[value.name] = value(data[key]);