mcmaniac: fix regex #2

schema: make mcmaniac items case-insensitive
This commit is contained in:
jkhsjdhjs 2021-01-06 19:44:19 +00:00
parent 51bf31e2a5
commit 7036bceeb0
2 changed files with 2 additions and 3 deletions

View File

@ -49,8 +49,7 @@ class McManiac(DatabasePlugin):
if result:
return '[{rank}/{total}] {item}'.format(**result)
# TODO: fix regex ("McFooiaC McBariaC" adds "Mc\S+iaC")
@irc3.event(r'^:(?P<mask>\S+) PRIVMSG \S+ :.*?(?P<item>Mc\S+iaC).*')
@irc3.event(r'^:(?P<mask>\S+) PRIVMSG \S+ :.*?\b(?P<item>Mc\S+iaC)\b.*')
def save(self, mask: str, item: str):
if IrcString(mask).nick != self.bot.nick:
with self.con.cursor() as cur:

View File

@ -10,7 +10,7 @@ create table if not exists quotes (
create table if not exists mcmaniacs (
id serial primary key,
item text not null,
item citext not null,
unique (item)
);