about summary refs log tree commit diff
path: root/tracer.py
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2019-05-28 13:47:59 -0400
committerBen Harris <ben@tilde.team>2019-05-28 13:47:59 -0400
commit0d3ced567c08f41b26d49efb8ecac069c3306345 (patch)
treeb423c35a3c6e8dab3c2c045172012e2bac34b645 /tracer.py
parentaade0d53f7b22c7ceb226dd176bc9abab7c24ad7 (diff)
shorter swapping algo and !!help
Diffstat (limited to 'tracer.py')
-rwxr-xr-xtracer.py7
1 files 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<nick>[^ ]+)!.*PRIVMSG #(?P<chan>\w+) :(?P<msg>.*)", ircmsg