Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: github/hubot
...
head fork: copyhacker/hubot
compare: campfire-broadcast
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
8 src/hubot/campfire.coffee
@@ -3,6 +3,14 @@ HTTPS = require "https"
EventEmitter = require("events").EventEmitter
class Campfire extends Robot
+ broadcast: (strings...) ->
+ if strings.length > 0
+ for roomId in bot.rooms
+ do (roomId) ->
+ bot.Room(roomId).speak strings.shift(), (err, data) =>
+ console.log "campfire error: #{err}" if err
+ @send user, strings...
+
send: (user, strings...) ->
if strings.length > 0
@bot.Room(user.room).speak strings.shift(), (err, data) =>
View
4 src/hubot/shell.coffee
@@ -1,6 +1,10 @@
Robot = require '../robot'
class Shell extends Robot
+ broadcast: (strings...) ->
+ for str in strings
+ console.log "Broadcasting: #{str}"
+
send: (user, strings...) ->
for str in strings
console.log str
View
5 src/robot.coffee
@@ -130,6 +130,11 @@ class Robot
# Public: Raw method for sending data back to the chat source. Extend this.
#
+ # strings - One or more Strings for each message to send.
+ broadcast: (strings...) ->
+
+ # Public: Raw method for sending data back to the chat source. Extend this.
+ #
# user - A Robot.User instance.
# strings - One or more Strings for each message to send.
send: (user, strings...) ->

No commit comments for this range

Something went wrong with that request. Please try again.