function morningMsg(user, rival) {
var msgToSend = '';
//get quote
//morning message
if (user.yesterday.wDist >= 500) {
if (user.yesterday.wDist > rival.yesterday.wDist) {
msgToSend = "Yesterday you walked " + getDistance(user.yesterday.wDist) + " in " + getDuration(user.yesterday.wDur) + ". ";
msgToSend += "You beat " + rival.nickname + " by " + getDistance(user.yesterday.wDist - rival.yesterday.wDist) + ". ";
if (user.daily.wDist > user.stats.average.monthly.wDist) {
msgToSend += "Good job. That's better than your monthly average of " + getDistance(user.stats.average.monthly.wDist);
}
} else if (user.yesterday.wDist < rival.yesterday.wDist) {
msgToSend = "Yesterday you walked " + getDistance(user.yesterday.wDist) + " " + getDuration(user.yesterday.wDur) + ". ";
msgToSend += rival.nickname + " beat you by " + getDistance(rival.yesterday.wDist - user.yesterday.wDist) + ". ";
if (user.daily.wDist > userAvgMonthWalk) {
msgToSend += "Good job. That's better than your monthly average of " + getDistance(user.stats.average.monthly.wDist);
}
}
} else {
msgToSend = "You barely walked yesterday. Get moving! ";
if (rival.yesterday.wDist > 500) {
msgToSend += 'Meanwhile ' + rival.nickname + ' walked ' + getDistance(rival.yesterday.wDist) + " in " + getDuration(rival.yesterday.wDur) + ". ";
}
}
return msgToSend;
}