Last active
August 29, 2015 14:10
-
-
Save manaten/2c2df56accfe590df215 to your computer and use it in GitHub Desktop.
hubot で configで指定している以外のチャンネルでhearした場合につぶやかないスクリプト。最初に読まれるように _ とかでファイル名を始める
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: | |
# Force hubot hearing messages only in rooms. | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: | |
# None | |
# | |
config = require 'config' | |
_ = require 'lodash' | |
module.exports = (robot) -> | |
robot.hear /.*/, (msg) -> | |
if _.contains config.roomLimit.specialUsers, msg.envelope.user.name | |
return | |
unless _.contains config.roomLimit.rooms, msg.envelope.room | |
# see https://github.com/github/hubot/issues/200 | |
msg.finish() | |
if /bot/.test msg.envelope.user.name | |
msg.finish() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
configはこんなかんじ