forked from Galactic/galactic-bot
method for checking invite
This commit is contained in:
parent
6ab22a02bf
commit
f632ae54b4
@ -17,8 +17,19 @@ const Guild = Structures.extend('Guild', (Guild) => {
|
|||||||
this.callbacks = [];
|
this.callbacks = [];
|
||||||
this.webhooks = new Collection();
|
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
|
//Fetch and cache settings
|
||||||
async settings() {
|
async settings() {
|
||||||
if(!this._settings) this._settings = this.client.storageManager.mongodb.guilds.findOne({ guildId: this.id });
|
if(!this._settings) this._settings = this.client.storageManager.mongodb.guilds.findOne({ guildId: this.id });
|
||||||
|
Loading…
Reference in New Issue
Block a user