mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 21:29:24 +01:00
* Decided to ditch the "_is_" syntax. I never liked it and implementing it
may prove to be difficult here. It may find its way back in, but there's no point in having it in there now when it doesn't work right anyway.
This commit is contained in:
parent
aee5c6c18e
commit
a63ee1e304
@ -221,14 +221,14 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
irc.error(msg, "Spurious type from parseFactoid.")
|
irc.error(msg, "Spurious type from parseFactoid.")
|
||||||
|
|
||||||
def addFactoid(self, irc, msg, match):
|
def addFactoid(self, irc, msg, match):
|
||||||
r"^(?!no\s+)(.+)\s+(is|_is_)\s+(?!also)(.+)"
|
r"^(?!no\s+)(.+)\s+is\s+(?!also)(.+)"
|
||||||
# Must be registered!
|
# Must be registered!
|
||||||
try:
|
try:
|
||||||
id = ircdb.users.getUserId(msg.prefix)
|
id = ircdb.users.getUserId(msg.prefix)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(msg, conf.replyNotRegistered)
|
irc.error(msg, conf.replyNotRegistered)
|
||||||
return
|
return
|
||||||
key, _, fact = match.groups()
|
key, fact = match.groups()
|
||||||
cursor = self.db.cursor()
|
cursor = self.db.cursor()
|
||||||
# Check and make sure it's not in the DB already
|
# Check and make sure it's not in the DB already
|
||||||
cursor.execute("""SELECT * FROM factoids WHERE key = %s""", key)
|
cursor.execute("""SELECT * FROM factoids WHERE key = %s""", key)
|
||||||
@ -309,14 +309,14 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
irc.reply(msg, conf.replySuccess)
|
irc.reply(msg, conf.replySuccess)
|
||||||
|
|
||||||
def replaceFactoid(self, irc, msg, match):
|
def replaceFactoid(self, irc, msg, match):
|
||||||
r"^no,?\s+(.+)\s+(is|_is_)\s+(.+)"
|
r"^no,?\s+(.+)\s+is\s+(.+)"
|
||||||
# Must be registered!
|
# Must be registered!
|
||||||
try:
|
try:
|
||||||
id = ircdb.users.getUserId(msg.prefix)
|
id = ircdb.users.getUserId(msg.prefix)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(msg, conf.replyNotRegistered)
|
irc.error(msg, conf.replyNotRegistered)
|
||||||
return
|
return
|
||||||
key, _, new_fact = match.groups()
|
key, new_fact = match.groups()
|
||||||
cursor = self.db.cursor()
|
cursor = self.db.cursor()
|
||||||
# Check and make sure it's in the DB
|
# Check and make sure it's in the DB
|
||||||
cursor.execute("""SELECT locked_at, fact FROM factoids
|
cursor.execute("""SELECT locked_at, fact FROM factoids
|
||||||
|
Loading…
Reference in New Issue
Block a user