Jelajahi Sumber

statistic commands

tBKwtWS 7 tahun lalu
induk
melakukan
763034cbad
1 mengubah file dengan 5 tambahan dan 6 penghapusan
  1. 5 6
      commands/statistics.py

+ 5 - 6
commands/statistics.py

@@ -19,10 +19,10 @@ def do_command(self, connection, event):
 
     if command == "cmd" or command == "commands":
         if cmdtype == "cmd":
-            connection.privmsg(replyto, grey + "Statistics commands: " + CH.ccc(self, "joins") + CH.ccc(self, "kicks") + CH.ccc(self, "messages")[:-2] + ".")
+            connection.privmsg(replyto, grey + "Statistics commands: " + CH.ccc(self, "joins") + CH.ccc(self, "kicks") + CH.ccc(self, "messages") + CH.ccc(self, "actions") + CH.ccc(self, "notices")[:-2] + ".")
     
     
-    elif command.split()[0] == "joins" or command.split()[0] == "kicks" or command.split()[0] == "messages":
+    elif command.split()[0] == "joins" or command.split()[0] == "kicks" or command.split()[0] == "messages" or command.split()[0] == "actions" or command.split()[0] == "notices":
         if cmdtype == "help":    #Display help text.
             if len(command.split()) is not 1:
                 return
@@ -117,14 +117,13 @@ def do_command(self, connection, event):
                         connection.action(replyto, "has not noticed " + red + user + reset + ".")
                         return
                 messages, words, characters = StatisticsHelpers.add_message_stats(userstat)
-                message = "Totals of " + red + user + " " + green + str(messages) + reset + " messages, " + green + str(words) + reset + " words, " + green + str(characters) + reset + " characters."
+                message = "Totals of " + red + user + " " + green + str(messages) + reset + " " + blue + command.split()[0] + reset + ", " + green + str(words) + reset + " words, " + green + str(characters) + reset + " characters."
                 if channel: # User and channel.
                     userchanstat = self.db.one("SELECT " + command.split()[0] + ", " + command.split()[0] + "_words, " + command.split()[0] + "_characters FROM messages WHERE lower(channel)=lower('" + channel + "') AND channel_network='" + self.network + "' AND lower(\"user\")=lower('" + user + "') AND user_network='" + self.network + "'")
                     chanstat = self.db.all("SELECT " + command.split()[0] + ", " + command.split()[0] + "_words, " + command.split()[0] + "_characters FROM messages WHERE lower(channel)=lower('" + channel + "') AND channel_network='" + self.network + "'")
                     if userchanstat:
-                        message += " " + red + user + reset + " in " + red + channel + " " + green + str(userchanstat[0]) + reset + " mssgs, " + green + str(userchanstat[1]) + reset + " words, " + green + str(userchanstat[2]) + reset + " chars."
+                        message += " " + red + user + reset + " in " + red + channel + " " + green + str(userchanstat[0]) + reset + " " + blue + command.split()[0] + reset + ", " + green + str(userchanstat[1]) + reset + " words, " + green + str(userchanstat[2]) + reset + " chars."
                     if chanstat:
                         messages, words, characters = StatisticsHelpers.add_message_stats(chanstat)
-                        message += " Total in " + red + channel + " " + green + str(messages) + reset + " msg, " + green + str(words) + reset + " wrd, " + green + str(characters) + reset + " chr."
-                    
+                        message += " Total in " + red + channel + " " + green + str(messages) + reset + " " + blue + command.split()[0] + reset + ", " + green + str(words) + reset + " wrd, " + green + str(characters) + reset + " chr." 
                 connection.privmsg(replyto, message)