forked from Galactic/galactic-bot
put point expiration behind a condition
This commit is contained in:
parent
fde694b36a
commit
10d4c5cebf
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user