tBKwtWS 6 年之前
父節點
當前提交
a36ebcf6ff
共有 2 個文件被更改,包括 35 次插入35 次删除
  1. 10 10
      rotbot/commands/admin.py
  2. 25 25
      rotbot/common/do_everything_to.py

+ 10 - 10
rotbot/commands/admin.py

@@ -117,7 +117,7 @@ def do_command(self, connection, event, user, channel):
             connection.privmsg(replyto,  font.grey + "Usage: " + font.blue + "!quit " + font.reset + font.italic + "reason")
         elif cmdtype == "cmd":
             if not userstatus.atleast_admin(self, event.source.nick, self.network.home_channel): #Insufficient rights.
-                connection.privmsg(replyto, "Denied, you need to have admin (super operator) status or higher in " + font.font.red + self.network.home_channel  + font.reset + ".")
+                connection.privmsg(replyto, "Denied, you need to have admin (super operator) status or higher in " + font.red + self.network.home_channel  + font.reset + ".")
                 return
             if len(command.split()) == 1:
                 log.info("Killed by: " + event.source.nick)
@@ -128,7 +128,7 @@ def do_command(self, connection, event, user, channel):
 
     elif one == "reconnect":
         if not userstatus.atleast_oper(self, event.source.nick, self.network.home_channel):
-            connection.privmsg(replyto, "Denied, you need to have operator status or higher in " + font.font.red + self.network.home_channel  + font.reset + ".")
+            connection.privmsg(replyto, "Denied, you need to have operator status or higher in " + font.red + self.network.home_channel  + font.reset + ".")
             return
         if cmdtype == "help":    # Display help text.
             if len(command.split()) != 1:
@@ -143,7 +143,7 @@ def do_command(self, connection, event, user, channel):
 
     elif one == "recovernick":
         if not userstatus.atleast_voiced(self, event.source.nick, self.network.home_channel):
-            connection.privmsg(replyto, "Denied, you need to have voiced status or higher in " + font.font.red + self.network.home_channel  + font.reset + ".")
+            connection.privmsg(replyto, "Denied, you need to have voiced status or higher in " + font.red + self.network.home_channel  + font.reset + ".")
             return
         if cmdtype == "help":    # Display help text.
             if len(command.split()) != 1:
@@ -151,20 +151,20 @@ def do_command(self, connection, event, user, channel):
             connection.privmsg(replyto, "Let " + connection.get_nickname() + " try to recover " + connection.nickname + " as nickname.")
         elif cmdtype == "cmd":
             if connection.get_nickname() == connection.nickname:
-                connection.action(replyto,  "is already named " + font.font.red + connection.nickname + font.reset + ".")
+                connection.action(replyto,  "is already named " + font.red + connection.nickname + font.reset + ".")
                 return
             from common.networkservices import NickServ
             NickServ.recover_nick(connection, self.password)
 
     elif one == "join":
         if not userstatus.atleast_oper(self, event.source.nick, self.network.home_channel):
-            connection.privmsg(replyto, "Denied, you need to have operator status or higher in " + font.font.red + self.network.home_channel  + font.reset + ".")
+            connection.privmsg(replyto, "Denied, you need to have operator status or higher in " + font.red + self.network.home_channel  + font.reset + ".")
             return
         if cmdtype == "help":    #Display help text.
             if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Make " + connection.get_nickname() + " join a channel. Password optional.")
-            connection.privmsg(replyto, font.grey + "Usage: " + font.blue + self.cmdchar + "join " + font.font.red + font.italic + "channel " + font.reset + font.italic + "password")
+            connection.privmsg(replyto, font.grey + "Usage: " + font.blue + self.network.command_character + "join " + font.red + font.italic + "channel " + font.reset + font.italic + "password")
         elif cmdtype == "cmd":
             try:
                 channel = command.split()[1]
@@ -183,7 +183,7 @@ def do_command(self, connection, event, user, channel):
             if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Make " + connection.get_nickname() + " part a channel. Reason optional.")
-            connection.privmsg(replyto, font.grey + "Usage: " + font.blue + self.cmdchar + "join " + font.font.red + font.italic + "channel " + font.reset + font.italic + "password")
+            connection.privmsg(replyto, font.grey + "Usage: " + font.blue + self.network.command_character + "join " + font.red + font.italic + "channel " + font.reset + font.italic + "password")
         elif cmdtype == "cmd":
 
             homeadmin = False
@@ -197,7 +197,7 @@ def do_command(self, connection, event, user, channel):
             if len(command.split()) == 1:   # No arguments.
                 if event.target in self.channels:   # It's a channel message.
                     if not homeadmin and not targetadmin:   # Insufficient rights:
-                        connection.privmsg(replyto, "Denied. You need to have at least operator status in " + font.font.red + self.homechan + font.reset + " or " + font.font + event.target + font.reset + ".")
+                        connection.privmsg(replyto, "Denied. You need to have at least operator status in " + font.red + self.homechan + font.reset + " or " + font + event.target + font.reset + ".")
                         return
                     if event.target == self.network.home_channel:
                         connection.action(replyto, "shall not abandon it's home channel!")
@@ -337,7 +337,7 @@ def do_command(self, connection, event, user, channel):
     #                 connection.privmsg(replyto, command.split()[1] + " is not a channel I inhabit. For help type " + font.blue + self.network.help_character + "channelfunctions" + font.reset + ".")
     #                 return
     #             if not AH.is_channelfunction(command.split()[2]):  # Function does not exist.
-    #                 connection.privmsg(replyto, command.split()[2] + " is not a valid channel function. For a list help type: " + font.blue + self.cmdchar + "channelfunctions" + font.red + font.italic + "channel")
+    #                 connection.privmsg(replyto, command.split()[2] + " is not a valid channel function. For a list help type: " + font.blue + self.network.command_character + "channelfunctions" + font.red + font.italic + "channel")
     #                 return
     #
     #             if not command.split()[3].lower() in ["on", "off"] and not command.split()[2].lower() == "aggressiveness": # Third argument unsupported.
@@ -364,7 +364,7 @@ def do_command(self, connection, event, user, channel):
             if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Register with NickServ.")
-            connection.privmsg(replyto, font.grey + "Usage: " + font.blue + self.cmdchar + "registernick " + font.reset + font.italic + "email")
+            connection.privmsg(replyto, font.grey + "Usage: " + font.blue + self.network.command_character + "registernick " + font.reset + font.italic + "email")
         elif cmdtype == "cmd":
 
             if len(command.split()) == 1:

+ 25 - 25
rotbot/common/do_everything_to.py

@@ -1,36 +1,36 @@
 from common.networkservices import ChanServ
 
-def join(self, connection, channel, key=False):
-    #ChanServ.unban(connection, channel, connection.get_nickname())
-    #ChanServ.akick_del(connection, channel, connection.get_nickname())
-    #ChanServ.invite(connection, channel)
-    #ChanServ.getkey(connection, channel)
-    #knownkey = self.db.one("SELECT key FROM channels WHERE name=%(channel)s AND network=%(network)s", channel=channel, network=self.network.id)
+def join(self, connection, channel_name_name, key=False):
+    #ChanServ.unban(connection, channel_name, connection.get_nickname())
+    #ChanServ.akick_del(connection, channel_name, connection.get_nickname())
+    #ChanServ.invite(connection, channel_name)
+    #ChanServ.getkey(connection, channel_name)
+    #knownkey = self.db.one("SELECT key FROM channel_names WHERE name=%(channel_name)s AND network=%(network)s", channel_name=channel_name, network=self.network.id)
     # if key:
-    #     connection.join(channel, key)
+    #     connection.join(channel_name, key)
     #     if not key == knownkey:
-    #         self.channelkeys[channel] = key
+    #         self.channel_namekeys[channel_name] = key
     # elif knownkey:
-    #     connection.join(channel, key)
+    #     connection.join(channel_name, key)
     # else:
-    connection.join(channel)
+    connection.join(channel_name_name)
 
-def unban(connection, channel, user, mask):
-    ChanServ.unban(connection, channel, user)
-    connection.mode(channel, "-b " + mask)
+def unban(connection, channel_name, user_name, mask):
+    ChanServ.unban(connection, channel_name, user_name)
+    connection.mode(channel_name, "-b " + mask)
 
-def ban(connection, channel, user, mask, reason):
-    ChanServ.ban(connection, channel, user, reason)
-    connection.mode(channel, "+b " + mask)
+def ban(connection, channel_name, user_name, mask, reason):
+    ChanServ.ban(connection, channel_name, user_name, reason)
+    connection.mode(channel_name, "+b " + mask)
 
-def banhost(connection, channel, mask, reason):
-    ChanServ.ban(connection, channel, mask, reason)
-    connection.mode(channel, "+b " + mask)
+def banhost(connection, channel_name, mask, reason):
+    ChanServ.ban(connection, channel_name, mask, reason)
+    connection.mode(channel_name, "+b " + mask)
 
-def kick(connection, channel, user, reason):
-    ChanServ.kick(connection, channel, user, reason)
-    connection.kick(channel, user, reason)
+def kick(connection, channel_name, user_name, reason):
+    ChanServ.kick(connection, channel_name, user_name, reason)
+    connection.kick(channel_name, user_name, reason)
 
-def bankick(connection, channel, user, mask, reason):
-    ban(connection, channel, user, mask, reason)
-    kick(connection, channel, user, reason)
+def bankick(connection, channel_name, user_name, mask, reason):
+    ban(connection, channel_name, user_name, mask, reason)
+    kick(connection, channel_name, user_name, reason)