 if err
 	console.error err
 	process.exit 1
-await db.collection "users", defer(err, collection)
+await db.collection "users", defer(err, Users_collection)
 if err
 	console.error err
 	process.exit 1

	bot.sendMessage DogeTipGroupID, "dogetippingbot is back online"
# Functions
getNameFromID = (steamID) ->
	bot.users[steamID].playerName

bot.on "chatMsg", (sourceID, message, type, chatterID) ->
	if message is "Me"

	switch message.split(" ")[0] # The command part
		when "+register"
			name = getNameFromID chatterID

			await checkIfRegistered chatterID, defer(registered)
			if registered is undefined
				return bot.sendMessage chatterID, "The database ran into an error"
			if registered
				return bot.sendMessage chatterID, "You've already registered"
			else
				userEntry =
					id: chatterID
					name: name
					funds: 0
					history: []
				await Users_collection.insert userEntry, {w:1}, defer(err)
				if err
					console.error "DBError: #{err}"
					return bot.sendMessage chatterID, "DBError: #{err}"
				bot.sendMessage chatterID, "Welcome #{name}"
				bot.sendMessage chatterID, "Reply '+add <AMOUNT> doge' to add dogecoins to your account"
				bot.sendMessage chatterID, "Tip users with '+tip <STEAM NAME> <AMOUNT> doge'"
		when "+add"
			previousAdds = no
			for payment in pendingPayments
