mirror of
https://github.com/progval/Limnoria.git
synced 2025-05-03 08:51:10 -05:00
Added getlart, getexcuse, getinsult.
This commit is contained in:
parent
091f2872b3
commit
1bc77baebe
@ -172,6 +172,21 @@ class FunDB(callbacks.Privmsg):
|
|||||||
s = insult
|
s = insult
|
||||||
irc.queueMsg(ircmsgs.privmsg(means, s))
|
irc.queueMsg(ircmsgs.privmsg(means, s))
|
||||||
|
|
||||||
|
def getinsult(self, irc, msg, args):
|
||||||
|
"""<id>"""
|
||||||
|
id = privmsgs.getArgs(args)
|
||||||
|
try:
|
||||||
|
id = int(id)
|
||||||
|
except ValueError:
|
||||||
|
irc.error(msg, 'The id must be an integer.')
|
||||||
|
return
|
||||||
|
cursor = self.db.cursor()
|
||||||
|
cursor.execute("""SELECT insult FROM insults WHERE id=%s""", id)
|
||||||
|
if cursor.rowcount == 0:
|
||||||
|
irc.error(msg, 'There is no such insult.')
|
||||||
|
else:
|
||||||
|
irc.reply(msg, cursor.fetchone()[0])
|
||||||
|
|
||||||
def addinsult(self, irc, msg, args):
|
def addinsult(self, irc, msg, args):
|
||||||
"""<insult>"""
|
"""<insult>"""
|
||||||
insult = privmsgs.getArgs(args)
|
insult = privmsgs.getArgs(args)
|
||||||
@ -229,6 +244,21 @@ class FunDB(callbacks.Privmsg):
|
|||||||
(id, excuse) = cursor.fetchone()
|
(id, excuse) = cursor.fetchone()
|
||||||
irc.reply(msg, '%s (#%s)' % (excuse, id))
|
irc.reply(msg, '%s (#%s)' % (excuse, id))
|
||||||
|
|
||||||
|
def getexcuse(self, irc, msg, args):
|
||||||
|
"""<id>"""
|
||||||
|
id = privmsgs.getArgs(args)
|
||||||
|
try:
|
||||||
|
id = int(id)
|
||||||
|
except ValueError:
|
||||||
|
irc.error(msg, 'The id must be an integer.')
|
||||||
|
return
|
||||||
|
cursor = self.db.cursor()
|
||||||
|
cursor.execute("""SELECT excuse FROM excuses WHERE id=%s""", id)
|
||||||
|
if cursor.rowcount == 0:
|
||||||
|
irc.error(msg, 'There is no such excuse.')
|
||||||
|
else:
|
||||||
|
irc.reply(msg, cursor.fetchone()[0])
|
||||||
|
|
||||||
def addexcuse(self, irc, msg, args):
|
def addexcuse(self, irc, msg, args):
|
||||||
"""<excuse>"""
|
"""<excuse>"""
|
||||||
excuse = privmsgs.getArgs(args)
|
excuse = privmsgs.getArgs(args)
|
||||||
@ -280,6 +310,21 @@ class FunDB(callbacks.Privmsg):
|
|||||||
lart = lart.replace("$who", lartee)
|
lart = lart.replace("$who", lartee)
|
||||||
irc.queueMsg(ircmsgs.action(channel, '%s (#%s)' % (lart, id)))
|
irc.queueMsg(ircmsgs.action(channel, '%s (#%s)' % (lart, id)))
|
||||||
|
|
||||||
|
def getlart(self, irc, msg, args):
|
||||||
|
"""<id>"""
|
||||||
|
id = privmsgs.getArgs(args)
|
||||||
|
try:
|
||||||
|
id = int(id)
|
||||||
|
except ValueError:
|
||||||
|
irc.error(msg, 'The id must be an integer.')
|
||||||
|
return
|
||||||
|
cursor = self.db.cursor()
|
||||||
|
cursor.execute("""SELECT lart FROM larts WHERE id=%s""", id)
|
||||||
|
if cursor.rowcount == 0:
|
||||||
|
irc.error(msg, 'There is no such lart.')
|
||||||
|
else:
|
||||||
|
irc.reply(msg, cursor.fetchone()[0])
|
||||||
|
|
||||||
def addlart(self, irc, msg, args):
|
def addlart(self, irc, msg, args):
|
||||||
"""<lart>
|
"""<lart>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user