From 0d3ced567c08f41b26d49efb8ecac069c3306345 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Tue, 28 May 2019 13:47:59 -0400 Subject: [PATCH] shorter swapping algo and !!help --- tracer.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tracer.py b/tracer.py index 7e1372a..4462005 100755 --- a/tracer.py +++ b/tracer.py @@ -71,9 +71,7 @@ def shuffle(col): if "origin" in [a, b]: print("origin discard") return col - temp = col[a] - col[a] = col[b] - col[b] = temp + col[a], col[b] = col[b], col[a] return col @@ -130,7 +128,7 @@ def think(chan, nick, msg): send(chan, res[0:475]) elif words[0] == "!!source": send(chan, "https://tildegit.org/ben/tracer") - elif words[0] == "!botlist": + elif words[0] == "!botlist" or words[0] == "!!help": send( chan, "helo i'm a tracery bot that makes cool things from tracery grammars in your ~/.tracery. see http://tracery.io for more info", @@ -165,6 +163,7 @@ if __name__ == "__main__": if "001" in ircmsg: for c in channels: rawsend(f"JOIN {c}") + rawsend(f"MODE {botnick} +B") m = re.match( ":(?P[^ ]+)!.*PRIVMSG #(?P\w+) :(?P.*)", ircmsg