Skip to content

Commit

Permalink
fix(Invite): #guild never resolving into a Guild (#6742)
Browse files Browse the repository at this point in the history
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
  • Loading branch information
ImRodry and SpaceEEC committed Oct 2, 2021
1 parent 107822d commit b76bb8a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/structures/Invite.js
Expand Up @@ -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.id) ?? new InviteGuild(this.client, data.guild);
}

/**
Expand Down

0 comments on commit b76bb8a

Please sign in to comment.