Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 29 lines (24 sloc) 0.833 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
# Description
# Allows you to "yell" your message to everyone in the room
#
# Dependencies:
# "underscore": "1.3.3"
#
# Configuration:
# None
#
# Commands:
# hubot yell <message> - Sends your message and mentions everyone curently in the chat room.
#
# Notes:
# Nobody likes when you yell all the time :(
#
# Author:
# MattSJohnston

module.exports = (robot) ->

  _ = require 'underscore'

  robot.respond /yell (.*)/i, (msg) ->
    users = _.reject((_.values _.pluck robot.brain.data.users, 'name'), (name) -> name == msg.message.user.name)
    msg.send if users.length then users.join(', ') + ": #{msg.match[1]}" else "If a tree falls in a forest and no one is around to hear it, does it make a sound?"


toTitleCase = (str) ->
  str.replace /\w\S*/g, (txt) -> txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
Something went wrong with that request. Please try again.