From aade0d53f7b22c7ceb226dd176bc9abab7c24ad7 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Tue, 28 May 2019 13:40:51 -0400 Subject: add unit and !botlist --- tracer.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tracer.py') 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[^ ]+)!.*PRIVMSG #(?P\w+) :(?P.*)", ircmsg) + m = re.match( + ":(?P[^ ]+)!.*PRIVMSG #(?P\w+) :(?P.*)", 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) - -- cgit 1.4.1