Skip to content

Commit

Permalink
Simplify substitutePattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Throne3d committed Mar 29, 2017
1 parent e4a994b commit 9848a89
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,7 @@ class Bot {
}

static substitutePattern(message, patternMapping) {
return message.replace(patternMatch, (match, varName) => {
if (varName in patternMapping) return patternMapping[varName];
return match;
});
return message.replace(patternMatch, (match, varName) => patternMapping[varName] || match);
}

sendToIRC(message) {
Expand Down

0 comments on commit 9848a89

Please sign in to comment.