 module.exports = (robot) ->
 
   BRAIN_KEY = 'hubot-slack-relay.storage'
+  IGNORE_BOTS = process.env.IGNORE_BOTS or true
   relays = []
+  client = robot.adapter.client
 
   brainLoaded = () =>
     #load brain data

        invalidChannelError relay

  robot.enter (res) ->
    for relay in relays
      if res.message.room isnt relay.localRoom then continue
      user = { room: relay.remoteRoom }


  robot.hear /(.+)/i, (res) =>

    if IGNORE_BOTS and  client.getUserByID(res.message.user.id).is_bot then return

    for relay in relays
      if res.message.room isnt relay.localRoom then continue
      user = { room: relay.remoteRoom }
