function PromptTeams(fbID, nextFunction){
	userLogins.find( {FB_ID: fbID}, function(err, doc){
		//make sure the user is logged into at least one team
		if(doc === null){
			console.error(fbID + " is not signed into any teams.");
			sendTextMessage(fbID, "You are not signed into any teams.");
			return;
		}
		//go through each of the user's logins, and add each team as a quick reply button
		let quickReplyButtons = [];
		doc.forEach(function(login){
			quickReplyButtons.push({
				"content_type" : "text",
				"title" : login.SLACK_TEAM_NAME,
				"payload" : nextFunction + "~_!" + login.SLACK_TEAM_NAME
			});
		});
		//build the message and send it to the user
		let messageData = {
			"recipient":{
				"id": fbID
			},
			"message":{
				"text":"Pick a team:",
				"quick_replies": quickReplyButtons
			}
		}
		callSendAPI(messageData);
	});
}
//Postconditions: sends fbID a message with each team they are signed into as a quick reply
sends fbID a message with each team they are signed into as a quick reply
sends fbID a message with each team they are signed into as a quick reply
function PromptTeams(fbID, nextFunction){
	userLogins.find( {FB_ID: fbID}, function(err, doc){
		if(doc === null){
			console.error(fbID + " is not signed into any teams.");
			sendTextMessage(fbID, "You are not signed into any teams.");
			return;
		}
		let quickReplyButtons = [];
		doc.forEach(function(login){
			quickReplyButtons.push({
				"content_type" : "text",
				"title" : login.SLACK_TEAM_NAME,
				"payload" : nextFunction + "~_!" + login.SLACK_TEAM_NAME
			});
		});
		let messageData = {
			"recipient":{
				"id": fbID
			},
			"message":{
				"text":"Pick a team:",
				"quick_replies": quickReplyButtons
			}
		}
		callSendAPI(messageData);
	});
}
function PromptTeams ( fbID , nextFunction ) { userLogins . find ( { FB_ID : fbID } , function ( err , doc ) { if ( doc === null ) { console . error ( fbID + " is not signed into any teams." ) ; sendTextMessage ( fbID , "You are not signed into any teams." ) ; return ; } let quickReplyButtons = [ ] ; doc . forEach ( function ( login ) { quickReplyButtons . push ( { "content_type" : "text" , "title" : login . SLACK_TEAM_NAME , "payload" : nextFunction + "~_!" + login . SLACK_TEAM_NAME } ) ; } ) ; let messageData = { "recipient" : { "id" : fbID } , "message" : { "text" : "Pick a team:" , "quick_replies" : quickReplyButtons } } callSendAPI ( messageData ) ; } ) ; }
Postconditions: sends fbID a message with each team they are signed into as a quick reply
Postconditions : sends fbID a message with each team they are signed into as a quick reply
//make sure the user is logged into at least one team //go through each of the user's logins, and add each team as a quick reply button //build the message and send it to the user