mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
fix(Invite): #guild never resolving into a Guild (#6742)
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user