perms fetch
This commit is contained in:
parent
f165ee2016
commit
d29107cced
@ -17,6 +17,14 @@ class GuildWrapper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
async settings(forceFetch = false) {
|
async settings(forceFetch = false) {
|
||||||
if (this._settings && !forceFetch) return this._settings;
|
if (this._settings && !forceFetch) return this._settings;
|
||||||
|
|
||||||
@ -43,6 +51,16 @@ class GuildWrapper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async permissions() {
|
||||||
|
if (this._permissions) return this._permissions;
|
||||||
|
|
||||||
|
const perms = await this.client.storageManager.mongodb.permissions.findOne({ guildId: this.id });
|
||||||
|
if (!perms) this._permissions = { guildId: this.id };
|
||||||
|
else this._permissions = perms;
|
||||||
|
|
||||||
|
return this._permissions;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update a webhook entry in the database
|
* Update a webhook entry in the database
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user