about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2020-05-01 13:15:15 -0400
committerBen Harris <ben@tilde.team>2020-05-01 13:15:15 -0400
commitb973b31c9785356d399187ae80ca18801c053e1f (patch)
tree33ce731f938f8ae7f3fa2f576b1e789cc9a5396c
parentfa3cdb77b078b9bc9d9ac6ad81ae042c5bba06c7 (diff)
update irctokens to v1.0.0
-rw-r--r--requirements.txt2
-rw-r--r--tracer.py16
-rw-r--r--tracer.service2
3 files changed, 10 insertions, 10 deletions
diff --git a/requirements.txt b/requirements.txt
index 628872a..f245902 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,2 @@
 tracery==0.1.1
-irctokens==0.7.0
+irctokens==1.0.0
diff --git a/tracer.py b/tracer.py
index 1b68451..8a4e430 100644
--- a/tracer.py
+++ b/tracer.py
@@ -111,7 +111,7 @@ def _send(line):
 
 
 def send(chan, msg):
-    _send(irctokens.format("PRIVMSG", [chan, msg]))
+    _send(irctokens.build("PRIVMSG", [chan, msg]))
 
 
 def think(line):
@@ -159,8 +159,8 @@ if __name__ == "__main__":
     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     s.connect((bot["server"], int(bot["port"])))
 
-    _send(irctokens.format("USER", [bot["nick"], "0", "*", "tracery bot"]))
-    _send(irctokens.format("NICK", [bot["nick"]]))
+    _send(irctokens.build("USER", [bot["nick"], "0", "*", "tracery bot"]))
+    _send(irctokens.build("NICK", [bot["nick"]]))
 
     while True:
         lines = d.push(s.recv(1024))
@@ -173,13 +173,13 @@ if __name__ == "__main__":
             print(f"< {line.format()}")
 
             if line.command == "PING":
-                _send(irctokens.format("PONG", [line.params[0]]))
+                _send(irctokens.build("PONG", [line.params[0]]))
 
             elif line.command == "001":
-                _send(irctokens.format("MODE", [bot["nick"], "+B"]))
+                _send(irctokens.build("MODE", [bot["nick"], "+B"]))
                 if account is not None:
                     _send(
-                        irctokens.format(
+                        irctokens.build(
                             "SQUERY",
                             [
                                 "NickServ",
@@ -190,10 +190,10 @@ if __name__ == "__main__":
                         )
                     )
 
-                _send(irctokens.format("JOIN", [",".join(bot.getlist("channels"))]))
+                _send(irctokens.build("JOIN", [",".join(bot.getlist("channels"))]))
 
             elif line.command == "INVITE":
-                _send(irctokens.format("JOIN", [line.params[1]]))
+                _send(irctokens.build("JOIN", [line.params[1]]))
 
             elif line.command == "PRIVMSG":
                 try:
diff --git a/tracer.service b/tracer.service
index 5a7e0fa..7ddf5ad 100644
--- a/tracer.service
+++ b/tracer.service
@@ -5,7 +5,7 @@ After=tracer.service
 [Service]
 Type=simple
 WorkingDirectory=/home/ben/workspace/tracer
-ExecStart=/home/ben/workspace/tracer/venv/bin/python3 tracer.py
+ExecStart=/usr/bin/python3 tracer.py
 Restart=always
 RestartSec=5
 StartLimitInterval=60s