From d6e684ad10348e5e16ce4850a20711d14e3cd739 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Fri, 13 Mar 2020 10:07:31 -0400 Subject: fix crash --- tooter.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tooter.py b/tooter.py index 6dbe28b..2910435 100644 --- a/tooter.py +++ b/tooter.py @@ -35,10 +35,9 @@ def think(line): chan = line.params.pop(0) words = line.params[0].split(" ") - if len(words) > 0 and line.hostmask.nickname != botnick: + if len(words) > 0 and line.hostmask.nickname != config["botnick"]: if words[0] == "!toot": status = emoji.emojize(" ".join(words[1:]), use_aliases=True) - print(f"{status} posted by {nick}") if chan == "#team": res = tildeteam.toot(status) else: @@ -64,7 +63,6 @@ if os.path.isfile(os.path.join(path, "account.json")): with open(os.path.join(path, "account.json"), "r") as f: account = json.load(f) -botnick = config["botnick"] channels = config["channels"] if len(sys.argv) > 1: for c in sys.argv[1:]: @@ -100,7 +98,7 @@ if __name__ == "__main__": _send(irctokens.format("PONG", line.params)) elif line.command == "001": - _send(irctokens.format("MODE", [botnick, "+B"])) + _send(irctokens.format("MODE", [config["botnick"], "+B"])) if account is not None: _send( irctokens.format( -- cgit 1.4.1