From d70bdf2ec4c8dbf1f840ec9e4cfde206f4d61745 Mon Sep 17 00:00:00 2001 From: Rodry <38259440+ImRodry@users.noreply.github.com> Date: Sat, 2 Oct 2021 21:24:44 +0100 Subject: [PATCH 1/2] fix(Invite): #guild never resolved into a Guild --- src/structures/Invite.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/structures/Invite.js b/src/structures/Invite.js index 6e79da85cede..2018d39f06af 100644 --- a/src/structures/Invite.js +++ b/src/structures/Invite.js @@ -20,14 +20,13 @@ class Invite extends Base { _patch(data) { const InviteGuild = require('./InviteGuild'); - const Guild = require('./Guild'); /** * The guild the invite is for including welcome screen data if present * @type {?(Guild|InviteGuild)} */ this.guild = null; if (data.guild) { - this.guild = data.guild instanceof Guild ? data.guild : new InviteGuild(this.client, data.guild); + this.guild = this.client.guilds.resolve(data.guild) ?? new InviteGuild(this.client, data.guild); } /** From 8a91e308e4d6d40ebbe61f602a5d1528e8eab2fc Mon Sep 17 00:00:00 2001 From: Rodry <38259440+ImRodry@users.noreply.github.com> Date: Sat, 2 Oct 2021 21:40:23 +0100 Subject: [PATCH 2/2] fix(Invite): GuildManager doesn't accept an api guild Co-authored-by: SpaceEEC --- src/structures/Invite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/Invite.js b/src/structures/Invite.js index 2018d39f06af..b9b3f42a8a0c 100644 --- a/src/structures/Invite.js +++ b/src/structures/Invite.js @@ -26,7 +26,7 @@ class Invite extends Base { */ this.guild = null; if (data.guild) { - this.guild = this.client.guilds.resolve(data.guild) ?? new InviteGuild(this.client, data.guild); + this.guild = this.client.guilds.resolve(data.guild.id) ?? new InviteGuild(this.client, data.guild); } /**