Fixed .jn command and added todo for wrong mcmaniac regex

This commit is contained in:
mrhanky 2017-07-06 14:40:48 +02:00
parent c941b43109
commit 8d3afdb00d
No known key found for this signature in database
GPG Key ID: 67D772C481CB41B8
2 changed files with 4 additions and 3 deletions

View File

@ -54,6 +54,7 @@ class McManiac(DatabasePlugin):
if result: if result:
return '[{rank}/{total}] {item}'.format(**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+ :.*(?P<item>Mc\S+iaC).*')
def save(self, mask: str, item: str): def save(self, mask: str, item: str):
if IrcString(mask).nick != self.bot.nick: if IrcString(mask).nick != self.bot.nick:

View File

@ -104,7 +104,7 @@ class Useless(DatabasePlugin):
users (nick, waifu) users (nick, waifu)
values values
(%s, %s) (%s, %s)
on conflict (nick) do update set on conflict (nick) do update set
waifu = excluded.waifu waifu = excluded.waifu
''', [mask.nick, waifu]) ''', [mask.nick, waifu])
@ -142,7 +142,7 @@ class Useless(DatabasePlugin):
users (nick, husbando) users (nick, husbando)
values values
(%s, %s) (%s, %s)
on conflict (nick) do update set on conflict (nick) do update set
husbando = excluded.husbando husbando = excluded.husbando
''', [mask.nick, nick]) ''', [mask.nick, nick])
@ -188,7 +188,7 @@ class Useless(DatabasePlugin):
def jn(self, mask: IrcString, target: IrcString, args: DocOptDict): def jn(self, mask: IrcString, target: IrcString, args: DocOptDict):
"""Decides between yes and no (for a question). """Decides between yes and no (for a question).
%%jn <question> %%jn <question>...
%%jn %%jn
""" """
choice = random.choice(['3Ja', '4Nein']) choice = random.choice(['3Ja', '4Nein'])