Created
September 3, 2018 13:14
-
-
Save ItsOnlyBinary/6bfb47f5506eade49cf270eced7a46c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kiwi.plugin('relay_tidy', function(kiwi, log) { | |
// Add the bot nicks here in lowercase | |
var relayNicks = ['relaybot']; | |
var relayedRegex = /^(\S+\/<(\S+)>)/; | |
kiwi.on('message.new', function(event) { | |
if (relayNicks.indexOf(event.nick.toLowerCase()) === -1) { | |
return; | |
} | |
var matches = relayedRegex.exec(event.message); | |
if (matches.length === 3) { | |
event.message = event.message.replace(relayedRegex, ''); | |
event.nick = matches[2]; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment