From dae59180000af5e638b45d04bb0cedb5772c3965 Mon Sep 17 00:00:00 2001 From: Navy Date: Sun, 24 May 2020 01:12:52 +0300 Subject: [PATCH] method resolver shorthand --- structure/interfaces/Setting.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/structure/interfaces/Setting.js b/structure/interfaces/Setting.js index 626cdcd..adeccad 100644 --- a/structure/interfaces/Setting.js +++ b/structure/interfaces/Setting.js @@ -47,13 +47,26 @@ class Setting extends Component { return { parsedArguments: response.parsedArguments, params: response.newArgs, error: false }; } + /** + * Resolves methods used primarily for settings, also deals with appending the arguments into existing lists + * + * @param {Array} args The incoming arguments with the first element being the method ex. ['add','ban','kick'] + * @param {Array} valid An array of items to compare to, if an argument doesn't exist in this array it'll be skipped over + * @param {Array} [existing=[]] Existing values in the array, valid elements will be appended to this + * @returns {Object} + * @memberof Resolver + */ + resolveMethod(args, valid, existing) { + return this.client.resolver.resolveMethod(args, valid, existing); + } + reason(executor) { return `[${this.moduleResolveable}] Executed by ${executor.tag} (${executor.id}).`; } async _handleReset(message) { await message.guild._removeSettings(this.index); - const msg = message.format('GENERAL_SETTINGRESET', { setting: this.resolveable }); + const msg = message.format('GENERAL_SETTINGRESET', { setting: this.name.toLowerCase() }); return { error: false, msg