Created
August 10, 2012 03:03
-
-
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)
This file contains 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
# 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