method resolver shorthand
This commit is contained in:
parent
cb05185f1e
commit
dae5918000
@ -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<String>} args The incoming arguments with the first element being the method ex. ['add','ban','kick']
|
||||
* @param {Array<String>} valid An array of items to compare to, if an argument doesn't exist in this array it'll be skipped over
|
||||
* @param {Array<String>} [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
|
||||
|
Loading…
Reference in New Issue
Block a user