Skip to content

Commit d9f0371

Browse files
committed
fix: ignore duration in new dgg !addban
1 parent 2a5d576 commit d9f0371

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/commands/implementations/banphrase.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ function banPhraseTwitch(defaultPunishmentDuration, punishmentType) {
5252

5353
function banPhraseDGG() {
5454
return (input, services) => {
55-
const bannedPhrase = input;
55+
const matched = /(\d+[HMDSWwhmds])?\s?(.*)/.exec(input);
56+
const bannedPhrase = _.get(matched, 2, '').toLowerCase();
5657
services.bannedPhrases.addBannedPhrase(bannedPhrase);
5758
return new CommandOutput(null, 'Phrase banned!');
5859
};
@@ -73,5 +74,5 @@ module.exports = {
7374
/(\d+[HMDSWwhmds])?\s?(.*)/,
7475
false,
7576
),
76-
addbanDGG: new Command(banPhraseDGG(), false, true),
77+
addbanDGG: new Command(banPhraseDGG(), false, true, /(\d+[HMDSWwhmds])?\s?(.*)/, false),
7778
};

0 commit comments

Comments
 (0)