about summary refs log tree commit diff
path: root/tooter.py
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2020-05-05 10:08:55 -0400
committerBen Harris <ben@tilde.team>2020-05-05 10:08:55 -0400
commita4b5440be5c10a43945d47c2da2eaa10b4c2c75b (patch)
treed901eb3f73ec778562de4b3b1fd2924f72782e95 /tooter.py
parent6cf2196551d9397d0d7509b16fa7e887b77da90d (diff)
parent383a33a0fae388ca2fafde82ac45e8f9b184b711 (diff)
Merge pull request 'case insensitivity for commands' (#1) from jesopo/tooter:master into master
Diffstat (limited to 'tooter.py')
-rw-r--r--tooter.py7
1 files 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)",