From ac6a03fa93a55eaf7cbe5e247b7c041d87af8a24 Mon Sep 17 00:00:00 2001 From: Navy Date: Sun, 19 Apr 2020 11:27:13 +0300 Subject: [PATCH] fetch settings --- structure/extensions/Guild.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/structure/extensions/Guild.js b/structure/extensions/Guild.js index f592024..d90834e 100644 --- a/structure/extensions/Guild.js +++ b/structure/extensions/Guild.js @@ -12,6 +12,14 @@ const Guild = Structures.extend('Guild', (Guild) => { } + async settings() { + + if (!this._settings) this._settings = this.client.transactionHandler._send({ provider: 'mongodb', request: { type: 'findOne', query: { guild: this.id } } }); + if (this._settings instanceof Promise) this._settings = await this._settings; + return this._settings; + + } + async resolveMembers(members, strict = false) { return await this.client.resolver.resolveMembers(members, this, strict);