|
|
@@ -300,6 +300,7 @@ QuizzBot.prototype.sendNextHint = function(resetTimer) {
|
|
|
}
|
|
|
|
|
|
QuizzBot.prototype.nextQuestionWrapper = function() {
|
|
|
+ this.previousQuestion = this.currentQuestion ? this.currentQuestion.id : null;
|
|
|
this.currentQuestion.end();
|
|
|
this.currentQuestion = null;
|
|
|
setTimeout(this.nextQuestion.bind(this), this.config.NEXT_QUESTION_DELAY);
|
|
|
@@ -516,6 +517,22 @@ QuizzBot.prototype.onMessageInternal = function(username, user, msg) {
|
|
|
this.bot.sendMsg(this.room, "Must be channel operator");
|
|
|
}
|
|
|
}
|
|
|
+ else if (lmsg === "!report prev") {
|
|
|
+ if (!this.previousQuestion) {
|
|
|
+ this.bot.sendMsg(this.room, "Erreur: question non trouvée");
|
|
|
+ } else {
|
|
|
+ Cache.reportQuestion(this.previousQuestion, username);
|
|
|
+ this.bot.sendMsg(this.room, "Question #" +this.previousQuestion +" marquée comme défectueuse par " +username);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (lmsg === "!report current") {
|
|
|
+ if (!this.currentQuestion) {
|
|
|
+ this.bot.sendMsg(this.room, "Erreur: question non trouvée");
|
|
|
+ } else {
|
|
|
+ Cache.reportQuestion(this.currentQuestion.id, username);
|
|
|
+ this.bot.sendMsg(this.room, "Question #" +this.currentQuestion.id +" marquée comme défectueuse par " +username);
|
|
|
+ }
|
|
|
+ }
|
|
|
else if (lmsg.startsWith("!report ")) {
|
|
|
var questionId = msg.substr("!report ".length).trim();
|
|
|
if (questionId.startsWith('#'))
|