 	bot.sendMessage DogeTipGroupID, "dogetippingbot is back online"
 # Functions
 getNameFromID = (steamID) ->
-	bot.users[steamID].playerName
+	name = bot.users[steamID]?.playerName
+checkIfRegistered = (steamID, cb) ->
+	await Users_collection.findOne {id: steamID}, defer(err, user)
+	if err
+		console.error err
+		cb undefined
+	registered = if user then true else false
+	cb registered
 
 bot.on "chatMsg", (sourceID, message, type, chatterID) ->
 	if message is "Me"

	switch message.split(" ")[0] # The command part
		when "+register"
			name = getNameFromID chatterID
			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

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