diff --git a/structure/extensions/Guild.js b/structure/extensions/Guild.js index b933243..6f4c954 100644 --- a/structure/extensions/Guild.js +++ b/structure/extensions/Guild.js @@ -17,8 +17,19 @@ const Guild = Structures.extend('Guild', (Guild) => { this.callbacks = []; this.webhooks = new Collection(); + this.invites = null; + } + async checkInvite(code) { + + // Is maintained by the utility hook + if (!this.invites && this.me.hasPermission('MANAGE_GUILD')) this.invites = await this.fetchInvites(); + return this.invites?.has(code) || false; + + } + + //Fetch and cache settings async settings() { if(!this._settings) this._settings = this.client.storageManager.mongodb.guilds.findOne({ guildId: this.id });