Skip to content

Commit 6385b43

Browse files
committed
Promise.resolve instead of arrow fn
1 parent d90d479 commit 6385b43

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

lib/commands/implementations/banphrase.js

+5-11
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@ function banphrase(defaultPunishmentDuration, punishmentType) {
1313
if (duration !== '') {
1414
parsedDuration = parseDurationToSeconds(duration);
1515
if (parsedDuration === null) {
16-
return new Promise((resolve) =>
17-
resolve(
18-
new CommandOutput(
19-
null,
20-
'Could not parse the duration. Usage: "!AddX {amount}{m,h,d,w} {some banned phrase} " !AddMute 1d YOU BEEN GNOMED',
21-
),
22-
),
23-
);
16+
return new Promise.resolve(new CommandOutput(
17+
null,
18+
'Could not parse the duration. Usage: "!AddX {amount}{m,h,d,w} {some banned phrase} " !AddMute 1d YOU BEEN GNOMED',
19+
));
2420
}
2521
}
2622

@@ -29,9 +25,7 @@ function banphrase(defaultPunishmentDuration, punishmentType) {
2925
// eslint-disable-next-line no-new
3026
new RegExp(bannedPhrase);
3127
} catch (e) {
32-
return new Promise((resolve) =>
33-
resolve(new CommandOutput(null, 'Could not add phrase. Invalid Regex.')),
34-
);
28+
return new Promise.resolve(new CommandOutput(null, 'Could not add phrase. Invalid Regex.'));
3529
}
3630
}
3731

0 commit comments

Comments
 (0)