function nightMsg(user, rival) {
var msgToSend = '';
//get quote
//morning message
if (user.daily.wDist >= 500) {
if (user.daily.wDist > rival.daily.wDist) {
msgToSend = "Today you walked " + getDistance(user.daily.wDist) + " in " + getDuration(user.yesterday.wDur) + ". ";
msgToSend += "You beat " + rival.nickname + " by " + getDistance(user.daily.wDist - rival.daily.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.daily.wDist < rival.daily.wDist) {
msgToSend = "Today you walked " + getDistance(user.daily.wDist) + " " + getDuration(user.daily.wDur) + ". ";
msgToSend += rival.nickname + " beat you by " + getDistance(rival.daily.wDist - user.daily.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 {
msgToSend = "You barely walked today. Maybe tomorrow? ";
if (rival.daily.wDist > 500) {
msgToSend += 'Meanwhile ' + rival.nickname + ' walked ' + getDistance(rival.daily.wDist) + " in " + getDuration(rival.daily.wDur) + ". ";
}
}
return msgToSend;
}