mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Fixed the self-lart bug.
This commit is contained in:
parent
581dcda8e0
commit
cdda36f9fb
@ -405,13 +405,13 @@ class FunDB(callbacks.Privmsg):
|
||||
id = 0
|
||||
if not nick:
|
||||
raise callbacks.ArgumentError
|
||||
|
||||
if nick == irc.nick:
|
||||
nick = msg.nick
|
||||
try:
|
||||
(nick, reason) = imap(' '.join,
|
||||
utils.itersplit('for'.__eq__, nick.split(), 1))
|
||||
except ValueError:
|
||||
reason = ''
|
||||
|
||||
cursor = self.db.cursor()
|
||||
if id:
|
||||
cursor.execute("""SELECT id, lart FROM larts WHERE id=%s""", id)
|
||||
@ -456,13 +456,11 @@ class FunDB(callbacks.Privmsg):
|
||||
id = 0
|
||||
if not nick:
|
||||
raise callbacks.ArgumentError
|
||||
|
||||
try:
|
||||
(nick, reason) = imap(' '.join,
|
||||
utils.itersplit('for'.__eq__, nick.split(), 1))
|
||||
except ValueError:
|
||||
reason = ''
|
||||
|
||||
cursor = self.db.cursor()
|
||||
if id:
|
||||
cursor.execute("""SELECT id, praise FROM praises WHERE id=%s""",id)
|
||||
@ -474,7 +472,6 @@ class FunDB(callbacks.Privmsg):
|
||||
WHERE praise NOTNULL
|
||||
ORDER BY random()
|
||||
LIMIT 1""")
|
||||
|
||||
if cursor.rowcount == 0:
|
||||
irc.error(msg, 'There are currently no available praises.')
|
||||
else:
|
||||
@ -524,6 +521,7 @@ class FunDB(callbacks.Privmsg):
|
||||
else:
|
||||
irc.reply(msg, 'That word has no anagrams that I know of.')
|
||||
|
||||
|
||||
Class = FunDB
|
||||
|
||||
|
||||
|
@ -69,6 +69,7 @@ if sqlite is not None:
|
||||
self.assertResponse('lart 2 jemfinch for being dumb',
|
||||
'\x01ACTION shoots jemfinch for being dumb '
|
||||
'(#2)\x01')
|
||||
self.assertNotRegexp('lart %s' % self.irc.nick, self.irc.nick)
|
||||
self.assertNotError('remove lart 1')
|
||||
self.assertRegexp('num lart', 'currently 1 lart')
|
||||
self.assertResponse('lart jemfinch',
|
||||
|
Loading…
Reference in New Issue
Block a user