3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-28 13:42:37 +01:00

fantasy: check for nick prefix case insensitively

This commit is contained in:
James Lu 2017-02-18 21:21:19 -08:00
parent 12bb59d257
commit 0c88602d1f

View File

@ -37,7 +37,7 @@ def handle_fantasy(irc, source, command, args):
# If responding to nick is enabled, add variations of the current nick
# to the prefix list: "<nick>," and "<nick>:"
nick = irc.users[servuid].nick
nick = irc.toLower(irc.users[servuid].nick)
if respondtonick:
prefixes += [nick+',', nick+':']
@ -48,8 +48,9 @@ def handle_fantasy(irc, source, command, args):
"fantasy commands will not work!", irc.name, botname)
continue
lowered_text = irc.toLower(orig_text)
for prefix in prefixes: # Cycle through the prefixes list we finished with.
if prefix and orig_text.startswith(prefix):
if prefix and lowered_text.startswith(prefix):
# Cut off the length of the prefix from the text.
text = orig_text[len(prefix):]