From 6cf2196551d9397d0d7509b16fa7e887b77da90d Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Fri, 1 May 2020 13:15:51 -0400 Subject: update irctokens to v1.0.0 --- tooter.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tooter.py') 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) -- cgit 1.4.1