#16 Commande !repete

Отворено
isundil жели да споји 2 комит(е) из irc.knacki.info/aide у irc.knacki.info/master
1 измењених фајлова са 8 додато и 1 уклоњено
  1. 8 1
      quizz.js

+ 8 - 1
quizz.js

@@ -159,6 +159,7 @@ QuizzBot.prototype.init = function(bot, chanName) {
     this.init = false;
     this.users = {};
     this.activeUsers = {};
+    this.sentHint = null;
 
     if (previousData) {
         for (var i in previousData.scores) {
@@ -227,6 +228,7 @@ QuizzBot.prototype.stop = function() {
     this.timer = null;
     this.currentQuestion = null;
     this.currentHint = 0;
+    this.sentHint = null;
 }
 
 QuizzBot.prototype.onTick = function() {
@@ -249,7 +251,8 @@ QuizzBot.prototype.resetTimer = function() {
 }
 
 QuizzBot.prototype.sendNextHint = function(resetTimer) {
-    this.bot.sendMsg(this.room, this.currentQuestion.getHint(this.currentHint));
+    this.sentHint = this.currentQuestion.getHint(this.currentHint);
+    this.bot.sendMsg(this.room, this.sentHint);
     ++this.currentHint;
     this.lastHint = Date.now();
     resetTimer !== false && this.resetTimer();
@@ -379,6 +382,10 @@ QuizzBot.prototype.onMessageInternal = function(username, user, msg) {
         else
             this.bot.sendMsg(this.room, "Must be channel operator");
     }
+    else if (lmsg.startsWith("!repete")) {
+        if (this.currentQuestion)
+            this.bot.sendMsg(this.room, `#${this.currentQuestion.id} ${this.currentQuestion.question}`);
+    }
     else if (lmsg.startsWith("!help")) {
         this.bot.sendMsg(this.room, "Besoin d'aide ? La liste des commandes utiles est sur ce site : https://git.knacki.info/irc.knacki.info/ircbot-quizz/src/master/quizz.md");
     }