fix crash

This commit is contained in:
Ben Harris 2020-03-13 10:07:31 -04:00
parent 9a858e9a29
commit d6e684ad10
1 changed files with 2 additions and 4 deletions

View File

@ -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(