Skip to content

Commit 5ab6a77

Browse files
committed
Factoids are now case-insentitive
1 parent 06433d7 commit 5ab6a77

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

plugins/factoids.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,17 @@ def info(text, notice):
127127
notice("Unknown Factoid.")
128128

129129

130+
factoid_re = re.compile(r'^{} ?(.+)'.format(re.escape(FACTOID_CHAR)), re.I)
131+
132+
130133
@asyncio.coroutine
131-
@hook.regex(r'^{} ?(.+)'.format(re.escape(FACTOID_CHAR)))
134+
@hook.regex(factoid_re)
132135
def factoid(match, async, event, message, action):
133136
"""<word> - shows what data is associated with <word>"""
134137

135138
# split up the input
136139
split = match.group(1).strip().split(" ")
137-
factoid_id = split[0]
140+
factoid_id = split[0].lower()
138141

139142
if len(split) >= 1:
140143
arguments = " ".join(split[1:])

0 commit comments

Comments
 (0)