mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +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) {
|
_patch(data) {
|
||||||
const InviteGuild = require('./InviteGuild');
|
const InviteGuild = require('./InviteGuild');
|
||||||
const Guild = require('./Guild');
|
|
||||||
/**
|
/**
|
||||||
* The guild the invite is for including welcome screen data if present
|
* The guild the invite is for including welcome screen data if present
|
||||||
* @type {?(Guild|InviteGuild)}
|
* @type {?(Guild|InviteGuild)}
|
||||||
*/
|
*/
|
||||||
this.guild = null;
|
this.guild = null;
|
||||||
if (data.guild) {
|
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