tBKwtWS 7 years ago
parent
commit
1dc0f4d5bf

BIN
commands/__pycache__/admin.cpython-36.pyc


BIN
commands/__pycache__/common.cpython-36.pyc


BIN
commands/__pycache__/public.cpython-36.pyc


+ 1 - 1
commands/admin.py

@@ -189,7 +189,7 @@ def do_command(self, connection, event):
             connection.privmsg(replyto,  grey + "Usage: " + blue + "!reconnect " + reset + italic + "reason")
         elif cmdtype == "cmd":
             if len(command.split()) == 1:
-                self.disconnect(msg = "reconnect requested by " + event.source.nick)
+                self.disconnect(msg = "Reconnect requested by " + event.source.nick)
             else:
                 self.disconnect(msg = "[" + event.source.nick + "] " + command.split(maxsplit=1)[1])
     

+ 2 - 2
commands/common.py

@@ -76,10 +76,10 @@ class CommandHelpers():
             games = "on"
         else:
             games = "off"
-        return ("autojoin" + autojoin + ", join_greeting " + joingreet + ", statistics_commands " + statscmds + ", games " + games + ".")
+        return ("autojoin " + autojoin + ", join_greeting " + joingreet + ", statistics_commands " + statscmds + ", games " + games + ".")
         
     def is_channelfunction(self, value):
-        if value not in ["join_greeting",  "statistics_commands",  "games"]:
+        if value not in ["autojoin", "join_greeting",  "statistics_commands",  "games"]:
             return False
         else:
             return True

+ 6 - 4
rotbot.py

@@ -51,11 +51,13 @@ class PyRot(irc.bot.SingleServerIRCBot):
             NickServ.recover_nick(connection, self.password)
     
     def on_welcome(self, connection, event):
-        print(event)
-        if self.password:
+        print(event)    # Handy for debugging. Keep this.
+        if self.password:   # Id with NickServ
             connection.privmsg("NickServ", "identify " + connection.nickname + " " + self.password) # Identify with NickServ.
-        self.db.all("SELECT name FROM channels WHERE network='" + self.network + "' AND autojoin=True")
-        print("Joining " + self.homechannel)
+        channels = self.db.all("SELECT name FROM channels WHERE network='" + self.network + "' AND autojoin=True")
+        connection.join(self.homechannel)
+        for channel in channels:    # Join channels with autojoin function.
+            connection.join(channel)
         connection.join(self.homechannel)