case insensitivity for commands

This commit is contained in:
jesopo 2020-05-05 11:04:52 +01:00
parent 6cf2196551
commit 383a33a0fa
1 changed files with 4 additions and 3 deletions

View File

@ -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)",