diff options
author | Ben Harris <ben@tilde.team> | 2020-05-01 13:15:51 -0400 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2020-05-01 13:15:51 -0400 |
commit | 6cf2196551d9397d0d7509b16fa7e887b77da90d (patch) | |
tree | 76353308f9e0abf12a5671bff2006ee0be4a25cd | |
parent | a1ae3eb42a0648e1875d9137c056d76e2d26d857 (diff) |
update irctokens to v1.0.0
-rw-r--r-- | requirements.txt | 2 | ||||
-rw-r--r-- | tooter.py | 16 | ||||
-rw-r--r-- | tooter.service | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/requirements.txt b/requirements.txt index 7ca04d1..74ea545 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ Mastodon.py==1.5.0 emoji==0.5.4 -irctokens==0.7.0 +irctokens==1.0.0 diff --git a/tooter.py b/tooter.py index c505836..7b900b3 100644 --- a/tooter.py +++ b/tooter.py @@ -28,7 +28,7 @@ def _send(line): def send(chan, msg): - _send(irctokens.format("PRIVMSG", [chan, msg])) + _send(irctokens.build("PRIVMSG", [chan, msg])) def think(line): @@ -81,8 +81,8 @@ if __name__ == "__main__": s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((config["address"], config["port"])) - _send(irctokens.format("USER", [config["botnick"], "0", "*", "mastodon tooter"])) - _send(irctokens.format("NICK", [config["botnick"]])) + _send(irctokens.build("USER", [config["botnick"], "0", "*", "mastodon tooter"])) + _send(irctokens.build("NICK", [config["botnick"]])) while True: lines = d.push(s.recv(1024)) @@ -95,13 +95,13 @@ if __name__ == "__main__": print(f"< {line.format()}") if line.command == "PING": - _send(irctokens.format("PONG", line.params)) + _send(irctokens.build("PONG", line.params)) elif line.command == "001": - _send(irctokens.format("MODE", [config["botnick"], "+B"])) + _send(irctokens.build("MODE", [config["botnick"], "+B"])) if account is not None: _send( - irctokens.format( + irctokens.build( "SQUERY", [ "NickServ", @@ -111,10 +111,10 @@ if __name__ == "__main__": ], ) ) - _send(irctokens.format("JOIN", [",".join(channels)])) + _send(irctokens.build("JOIN", [",".join(channels)])) elif line.command == "INVITE": - _send(irctokens.format("JOIN", line.params)) + _send(irctokens.build("JOIN", line.params)) elif line.command == "PRIVMSG": think(line) diff --git a/tooter.service b/tooter.service index d2354db..9eae6d3 100644 --- a/tooter.service +++ b/tooter.service @@ -5,7 +5,7 @@ After=tooter.service [Service] Type=simple WorkingDirectory=/home/ben/workspace/tooter -ExecStart=/home/ben/workspace/tooter/venv/bin/python3 tooter.py +ExecStart=/usr/bin/python3 tooter.py Restart=always RestartSec=5 StartLimitInterval=60s |