浏览代码

make search bot configurable; separate config variables for later

david 7 年之前
父节点
当前提交
34eb4881eb
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      ircclient.py

+ 5 - 3
ircclient.py

@@ -33,6 +33,10 @@ class IRCClient(Thread):
     TIME_TO_FIRST_COMMAND = 30
     HOST = "irc.irchighway.net"
     PORT = 6667
+    CHANNEL = "#ebooks"
+    PATH = "/tmp/"
+    SEARCH_BOT = "searchook"
+    # ^ config
     IGNORE = [
         "NOTICE",
         "PART",
@@ -49,8 +53,6 @@ class IRCClient(Thread):
         "265",
         "266",
         "396"]
-    CHANNEL = "#ebooks"
-    PATH = "/tmp/"
     STATUS = 'disconnected'
     joined_channel = False
     connected = False
@@ -105,7 +107,7 @@ class IRCClient(Thread):
         log.info("command %s", command)
 
         if command['mode'] == MODE_SEARCH:
-            self.send_queue.put("PRIVMSG %s :@searchook %s " % (self.CHANNEL, command['query']))
+            self.send_queue.put("PRIVMSG %s :@%s %s " % (self.CHANNEL, self.SEARCH_BOT, command['query']))
             return
         self.send_queue.put("PRIVMSG %s :%s " % (self.CHANNEL, command['query']))