diff options
author | Ben Harris <ben@tilde.team> | 2019-05-28 13:40:51 -0400 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2019-05-28 13:40:51 -0400 |
commit | aade0d53f7b22c7ceb226dd176bc9abab7c24ad7 (patch) | |
tree | 93e2462955dd1b329e7c88a200de2bd03946f725 /tracer.py | |
parent | 73945d8ec228c895c428b6a572b119291fc9c777 (diff) |
add unit and !botlist
Diffstat (limited to 'tracer.py')
-rwxr-xr-x | tracer.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tracer.py b/tracer.py index 55a529e..7e1372a 100755 --- a/tracer.py +++ b/tracer.py @@ -94,7 +94,7 @@ def fuse(argv): server = "127.0.0.1" -channels = ["#bots"] +channels = ["#bots", "#meta", "#team"] if len(sys.argv) > 1: for c in sys.argv[1:]: channels.append("#" + c) @@ -128,6 +128,13 @@ def think(chan, nick, msg): res = fuse(words[1:]) if res: send(chan, res[0:475]) + elif words[0] == "!!source": + send(chan, "https://tildegit.org/ben/tracer") + elif words[0] == "!botlist": + 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", + ) elif words[0][0:2] == "!!": print(words) res = generate(words[0][2:]) @@ -159,7 +166,9 @@ if __name__ == "__main__": for c in channels: rawsend(f"JOIN {c}") - m = re.match(":(?P<nick>[^ ]+)!.*PRIVMSG #(?P<chan>\w+) :(?P<msg>.*)", ircmsg) + m = re.match( + ":(?P<nick>[^ ]+)!.*PRIVMSG #(?P<chan>\w+) :(?P<msg>.*)", ircmsg + ) if m and m.groupdict(): m = m.groupdict() try: @@ -167,4 +176,3 @@ if __name__ == "__main__": except Exception as e: print("ERROR" + str(m)) print(e) - |