 
 userList = {}
 ignoreList = []
+ircBot = {}
 
 useFirebase = true
 
-if useFirebase
-	firebase = require('firebase')
-	auth = require('./auth.json')
-	# New proof of concept firebase thingy.
-	firebaseDomain = "https://blazing-fire-3008.firebaseio.com/"
-	db = new firebase(firebaseDomain)
-	db.auth auth.token, (error) ->
-		if error
-			console.log "[FAIL] Firebase Authication: ", error
-		else
-			console.log "[PASS] Firebase Authenticated"
-	dataRef = new firebase(firebaseDomain)
-	dataRef.on 'value', (snapshot) ->
-		db = snapshot.val()
-		ircNick = db.config.ircNick
-		ircChannel = db.config.ircChannel
-		ircServer = db.config.ircServer
-		channelId = db.config.channelId
-		userAgent = db.config.userAgent
-		ignoreList = db.ignoreList
-		userList = db.users
-
-else
-	# This should be replaced by a dict of prod/bob/haji that lets you select
-	# See http://api.mixlr.com/users/jeff-gerstmann for example channelId ("id")
-	botDefaults = 
-		ircNick: "jefflrbot"
-		ircChan: "#JeffDrives"
-		ircServ: "irc.freenode.org"
-		mixChan: 27902
-
-	botPersonalities =
-		"jefflr2":
-			ircNick: "jefflrbot2"
-			ircChan: "#JeffDrives2"
-		"haji":
-			ircNick: "devvlrbot"
-			ircChan: "#JeffDevs"
-
-	for name, opts in botPersonalities when process.argv is name
-		for key, val in opts
-			botDefaults[key] = val
-
-	# Won't Mixlr => IRC relay if from these usernames
-	ignoreList = [
-		"Minnie Marabella",
-		"WERD SLLIM"
-	]
-	# Ideally:
-	# .info minnie
-	# -> jefflr returns a minnie infospiel, including uid
-	# .ignore uid
-	# -> jefflr fucks off the uid and all aliases
-
-	# Users for IRC => Mixlr relay
-	userList =
-		"BobBarker":
-			"mixlrUserLogin": ""
-			"mixlrAuthSession": ""
-			"canHeart": true
-		"Hajitorus":
-			"mixlrUserLogin": ""
-			"mixlrAuthSession": ""
-			"canHeart": true
-
 # Creates the IRC client with given params
-ircBot = new irc.Client ircServer, ircNick,
-	password: null,
-	userName: ircNick,
-	realName: ircNick,
-	port: 6667,
-	debug: false,
-	showErrors: false,
-	autoRejoin: true,
-	autoConnect: true,
-	channels: [ircChannel],
-	retryCount: null,
-	retryDelay: 2000,
-	secure: false,
-	selfSigned: false,
-	certExpired: false,
-	floodProtection: true,
-	floodProtectionDelay: 200,
-	sasl: false,
-	stripColors: false,
-	channelPrefixes: "&#",
-	messageSplit: 512
-
-ircInitBot = ->
+ircInitBot = () ->
+	ircBot = new irc.Client ircServer, ircNick,
+		password: null,
+		userName: ircNick,
+		realName: ircNick,
+		port: 6667,
+		debug: false,
+		showErrors: false,
+		autoRejoin: true,
+		autoConnect: true,
+		channels: [ircChannel],
+		retryCount: null,
+		retryDelay: 2000,
+		secure: false,
+		selfSigned: false,
+		certExpired: false,
+		floodProtection: true,
+		floodProtectionDelay: 200,
+		sasl: false,
+		stripColors: false,
+		channelPrefixes: "&#",
+		messageSplit: 512
+
 	ircBot.addListener 'message', (from, to, message) ->
 		console.log '%s => %s: %s', from, to, message
 		return if from is ircBot.nick
 		for user, info of userList
+			console.log user, info
 			continue unless from == user
 			if message.toLowerCase() is "sup " + ircBot.nick
 				ircBot.say to, "OH YOU KNOW JUST ENSLAVING THE HUMAN RACE"

	ws.on 'close', ->
		console.log "WebSocket Closed"

# Starts up the IRC bot according to above config
ircInitBot()

# Opens a websocket connection, given the params below
openSock channelId

# vim: set noet ts=4:


# Opens a websocket connection and receives data as long as the connection remains open
# TODO: add in the ping function (seems to be every 5 minutes)
openSock = () ->
	broadcastStart = false
	channelSocket = JSON.stringify
		"event":
