From 383a33a0fae388ca2fafde82ac45e8f9b184b711 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 5 May 2020 11:04:52 +0100 Subject: [PATCH] case insensitivity for commands --- tooter.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tooter.py b/tooter.py index 7b900b3..4e98182 100644 --- a/tooter.py +++ b/tooter.py @@ -36,7 +36,8 @@ def think(line): words = line.params[0].split(" ") if len(words) > 0 and line.hostmask.nickname != config["botnick"]: - if words[0] == "!toot": + cmd = words[0].lower() + if cmd == "!toot": status = emoji.emojize(" ".join(words[1:]), use_aliases=True) if chan == "#team": res = tildeteam.toot(status) @@ -44,9 +45,9 @@ def think(line): res = tildeverse.toot(status) print(res) send(chan, "tooted! {}".format(res["url"])) - elif words[0] == "!source": + elif cmd == "!source": send(chan, "https://tildegit.org/ben/tooter") - elif words[0] == "!botlist" or words[0] == "!toothelp": + elif cmd in ["!botlist", "!toothelp"]: send( chan, "helo i can send toots from irc: @tildeverse@tilde.zone - from @tildeteam from the #team channel)",