Эх сурвалжийг харах

Merge branch 'aide' of irc.knacki.info/ircbot-quizz into master

isundil 6 жил өмнө
parent
commit
74129aa150
2 өөрчлөгдсөн 7 нэмэгдсэн , 8 устгасан
  1. 4 8
      quizz.js
  2. 3 0
      rapido.js

+ 4 - 8
quizz.js

@@ -177,6 +177,8 @@ QuizzBot.prototype.onSelfJoin = function() {
 QuizzBot.prototype.onJoin = function(nick) {
     this.users[nick.toLowerCase()] = this.users[nick.toLowerCase()] || this.bot.createUser(nick);
     this.activeUsers[nick.toLowerCase()] = true;
+  if (this.currentQuestion)
+    this.bot.sendNotice(nick, this.currentQuestion.question);
 }
 
 QuizzBot.prototype.onNameList = function(nicks) {
@@ -377,8 +379,8 @@ QuizzBot.prototype.onMessageInternal = function(username, user, msg) {
         else
             this.bot.sendMsg(this.room, "Must be channel operator");
     }
-    else if (lmsg.startsWith("!aide")) {
-        this.bot.sendMsg(this.room, "Usage: !aide | !indice | !reload | !next | !rename | !score [del pseudo] || !top");
+    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");
     }
     else if (lmsg === "!indice" || lmsg === "!conseil") {
         if (this.currentQuestion) {
@@ -457,12 +459,6 @@ QuizzBot.prototype.onMessageInternal = function(username, user, msg) {
             this.bot.sendMsg(this.room, "Question #" +questionId +" marquée comme défectueuse par " +username);
         }
     }
-    else if (lmsg.startsWith("!score del ")) {
-        if (user.admin)
-            this.delScore(msg.substr("!score del ".length).trim());
-        else
-            this.bot.sendMsg(this.room, "Must be channel operator");
-    }
     else if (lmsg.startsWith("!rename ")) {
         if (!user.admin) {
             this.bot.sendMsg(this.room, "Must be channel operator");

+ 3 - 0
rapido.js

@@ -198,6 +198,9 @@ Rapido.prototype.onMessageInternal = function(username, user, msg) {
         this.currentPoints.push({ username: username, time: Date.now()});
         this.bot.sendMsg(this.room, "Ok pour " +username);
     }
+    else if (lmsg.startsWith("!help")) {
+        this.bot.sendMsg(this.room, "Besoin d'aide ? Les règles ainsi que les commandes utiles sont ici : https://git.knacki.info/irc.knacki.info/ircbot-quizz/src/master/rapido.md");
+    }
 };
 
 module.exports = Rapido;