From 10d4c5cebf54d23c511d5b240277500e1da7de10 Mon Sep 17 00:00:00 2001 From: Navy Date: Thu, 6 May 2021 20:22:18 +0300 Subject: [PATCH] put point expiration behind a condition --- structure/interfaces/FilterSetting.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/structure/interfaces/FilterSetting.js b/structure/interfaces/FilterSetting.js index e5a4e5c..82c767d 100644 --- a/structure/interfaces/FilterSetting.js +++ b/structure/interfaces/FilterSetting.js @@ -70,19 +70,21 @@ module.exports = class FilterSetting extends Setting { } // Expiration - response = await message.prompt(message.format('S_FILTER_ACTION_ADD_EXPIRATION')); - if (!response) return { error: true, msg: message.format('ERR_TIMEOUT') }; - if (['cancel', 'abort', 'exit'].includes(action.toLowerCase())) return { - error: true, - msg: message.format('ERR_CANCEL') - }; + if (actionObject.points) { + response = await message.prompt(message.format('S_FILTER_ACTION_ADD_EXPIRATION')); + if (!response) return { error: true, msg: message.format('ERR_TIMEOUT') }; + if (['cancel', 'abort', 'exit'].includes(action.toLowerCase())) return { + error: true, + msg: message.format('ERR_CANCEL') + }; - if (!['no', 'n'].includes(response.content.toLowerCase())) { + if (!['no', 'n'].includes(response.content.toLowerCase())) { - const time = resolver.resolveTime(response.content); - if (!time) message.formattedRespond('S_FILTER_ACTION_ADD_EXPIRATION_FAIL'); - else actionObject.expiration = time; + const time = resolver.resolveTime(response.content); + if (!time) message.formattedRespond('S_FILTER_ACTION_ADD_EXPIRATION_FAIL'); + else actionObject.expiration = time; + } } }