Skip to content

Instantly share code, notes, and snippets.

@kiris
Created April 8, 2015 04:32
Show Gist options
  • Save kiris/47175177c8fe6409a4b8 to your computer and use it in GitHub Desktop.
Save kiris/47175177c8fe6409a4b8 to your computer and use it in GitHub Desktop.
Slackの新しいチャンネルが出来たらHubotに通知させる
# Description:
# notify create channel on Slack in #new_channels
#
# Notes:
# required hubot-slack@3.0.0+
#
# Author:
# kiris
module.exports = (robot) ->
slack = robot.adapter.client
slack.on 'raw_message', (message) ->
if message?.type == 'channel_created'
return if typeof robot?.send isnt 'function'
robot.send {room: "new_channels"}, "新しいチャンネル <##{message.channel.id}> が作られたみたいだお"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment