Created
September 28, 2016 21:59
-
-
Save voipnorm/be7c9a2b80c31c0f5af59da9939ec518 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
flint.hears(/\/broadcast( |.|$)/i, function(bot, trigger){ | |
var request = trigger.text.replace("/broadcast ",''); | |
if(trigger.personEmail.match(/youremail@example\.com|yourotheremail@example\.com/i)){ | |
_.forEach(flint.bots, function(bot) { bot.say(request); }); | |
}else{ | |
bot.say("Sorry but your are not authorised for this command. The authoritities have been notified."); | |
bot.dm('youremail@example.com','Unauthorised attempt by this person: '+trigger.personEmail); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment