Skip to content

Instantly share code, notes, and snippets.

@stephenyeargin
Created August 10, 2012 03:03
Show Gist options
  • Save stephenyeargin/3310650 to your computer and use it in GitHub Desktop.
Save stephenyeargin/3310650 to your computer and use it in GitHub Desktop.
Allows hubot to repeat what is in a private message (through IRC adapter)
# Description:
# Allows hubot to repeat what is in a private message (through IRC adapter)
#
# Dependencies:
# hubot-irc
#
# Configuration:
# None
#
# Commands:
# /msg hubot {what to say}
#
# Author:
# stephenyeargin
module.exports = (robot) ->
# This robot will say just about anything
robot.respond /(.*)$/i, (msg) ->
# Split room list into rooms array
rooms = process.env.HUBOT_IRC_ROOMS.split ","
# Only intercept private messages
if msg.message.user.room == null
# Send message to all applicable rooms
for room in rooms
robot.messageRoom(room, msg.match[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment