Skip to content

Commit

Permalink
score names have underscores to prevent notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
aceakash committed Dec 14, 2015
1 parent 18062bc commit 761121d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ quizRepo.getQuestionCount()
var type = message.type;
var text = message.text;

if (type === 'message' && channel && text) {
if (type === 'message' && channel && text && user) {

var player = findPlayer(user.id, players);

Expand All @@ -86,7 +86,7 @@ quizRepo.getQuestionCount()
channel.send(user.name + " answered correctly in " + timeDelta + " seconds");
}
} else if (prune(text) === 'scores') {
var scoreboard = players.map(function(p){ return p.name + ": " + p.points; }).join("\n")
var scoreboard = players.map(function(p){ return p.name.split('').join('_') + ": " + p.points; }).join("\n")
channel.send(":trophy: *Current Scores* :trophy: \n" + scoreboard);
} else if (prune(text) === 'q') {
quizRepo.getQuestionById(_.random(questionCount), function (err, doc) {
Expand Down

0 comments on commit 761121d

Please sign in to comment.