From 4dda6b98fb9ea7b61fe359adb426c536d6ecd41e Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 21 Sep 2020 21:48:46 +0300 Subject: [PATCH] cleanup --- .../components/settings/moderation/WordFilter.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/structure/client/components/settings/moderation/WordFilter.js b/structure/client/components/settings/moderation/WordFilter.js index 847fa21..d65045e 100644 --- a/structure/client/components/settings/moderation/WordFilter.js +++ b/structure/client/components/settings/moderation/WordFilter.js @@ -121,6 +121,15 @@ module.exports = class WordFilter extends Setting { } else if (['action', 'actions'].includes(method)) { + /** + * TODO: + * Refactor this somehow so I can use the same stuff on all of the filter settings + * Maybe a bunch of static methods in the setting superclass? + * Alternatively have an action builder on the client. + * + * Either way, the trigger part would need to be implemented per setting + */ + const submethod = args.shift().toLowerCase(); const resolved = await resolver.resolveMethod([submethod], null, null, null, null, false, ['add', 'remove', 'edit', 'list']); if (!resolved) return { error: true, msg: message.format('ERR_INVALID_METHOD', { method: submethod }) }; @@ -143,7 +152,7 @@ module.exports = class WordFilter extends Setting { if (result.error) return result; //setting.actions.push(result); - console.log(result); + //console.log(result); langParams = { type: result.action, duration: result.duration ? resolver.timeAgo(result.duration) : 'INF', @@ -469,7 +478,6 @@ module.exports = class WordFilter extends Setting { async _editType(message, setting, action) { const response = await message.prompt(message.format('S_WORDFILTER_ACTION_EDIT_TYPE', { valid: validInfractions.join('`, `') }), { time: 120 * 1000 }); - const { resolver } = this.client; if (!response) return { error: true, msg: message.format('ERR_TIMEOUT') }; if (['cancel', 'abort', 'exit'].includes(response.content.toLowerCase())) return {