diff --git a/lib/commands/implementations/banphrase.js b/lib/commands/implementations/banphrase.js index d9b55de..bf00301 100644 --- a/lib/commands/implementations/banphrase.js +++ b/lib/commands/implementations/banphrase.js @@ -13,14 +13,10 @@ function banphrase(defaultPunishmentDuration, punishmentType) { if (duration !== '') { parsedDuration = parseDurationToSeconds(duration); if (parsedDuration === null) { - return new Promise((resolve) => - resolve( - new CommandOutput( - null, - 'Could not parse the duration. Usage: "!AddX {amount}{m,h,d,w} {some banned phrase} " !AddMute 1d YOU BEEN GNOMED', - ), - ), - ); + return new Promise.resolve(new CommandOutput( + null, + 'Could not parse the duration. Usage: "!AddX {amount}{m,h,d,w} {some banned phrase} " !AddMute 1d YOU BEEN GNOMED', + )); } } @@ -29,9 +25,7 @@ function banphrase(defaultPunishmentDuration, punishmentType) { // eslint-disable-next-line no-new new RegExp(bannedPhrase); } catch (e) { - return new Promise((resolve) => - resolve(new CommandOutput(null, 'Could not add phrase. Invalid Regex.')), - ); + return new Promise.resolve(new CommandOutput(null, 'Could not add phrase. Invalid Regex.')); } }