Last active
June 28, 2016 13:50
-
-
Save rnalexander/d9ae2d09f194b2803f577c6e4275e37d to your computer and use it in GitHub Desktop.
Little coffee cluebot to drop into your hubot install. This one tells people not to use @here or @channel without some amount of context.
This file contains hidden or 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
# Applies the cluebat to people who are being uncool. | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: | |
# | |
# | |
# Author: | |
# Ryan Alexander | |
module.exports = (robot) -> | |
robot.hear /(.*(@here|@channel).*)/i, (msg) -> | |
alerted_content = msg.match[1] | |
if alerted_content.length < 20 | |
msg.reply "Please don't be lazy when using here or channel!\n When using here or channel commands, | |
everyone gets alerted and has to decide if they should go look at the problem in slack. | |
If you don't put enough information in the *same line* as the | |
channel or here, you're forcing people to go back to slack to find | |
out what's going on instead of letting them decide more quicly via the | |
information in the alert. This is selfish behavior, you're trading a | |
few seconds of your own time for a much greater amount of everyone | |
else's time. Unfortunately re-editing your last message to include the | |
here or channel command will not trigger the notification.\n | |
Our working practice on communication is here:[INSERT YOUR LINK HERE IF YOU HAVE ONE]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment