Skip to content

Commit

Permalink
Promise.resolve instead of arrow fn
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitchdev committed Jan 14, 2024
1 parent d90d479 commit 6385b43
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions lib/commands/implementations/banphrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
));
}
}

Expand All @@ -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.'));
}
}

Expand Down

0 comments on commit 6385b43

Please sign in to comment.