Skip to content

Instantly share code, notes, and snippets.

@rnalexander
Last active June 28, 2016 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rnalexander/d9ae2d09f194b2803f577c6e4275e37d to your computer and use it in GitHub Desktop.
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.
# 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