diff --git a/plugins/Dunno.py b/plugins/Dunno.py index 124742b46..f21644fa2 100644 --- a/plugins/Dunno.py +++ b/plugins/Dunno.py @@ -85,9 +85,7 @@ class Dunno(callbacks.Privmsg): FROM dunnos ORDER BY random() LIMIT 1""") - if cursor.rowcount == 0: - irc.error(msg, 'No dunnos available, add some with dunno add.') - else: + if cursor.rowcount != 0: dunno = cursor.fetchone()[0] dunno = dunno.replace('$who', msg.nick) irc.reply(msg, dunno, prefixName=False) @@ -130,7 +128,7 @@ class Dunno(callbacks.Privmsg): FROM dunnos WHERE id = %s""" % dunno_id) if cursor.rowcount == 0: - irc.error(msg, 'No dunno with id: %d' % dunno_id) + irc.error(msg, 'No dunno with id: %s' % dunno_id) return (added_by, dunno) = cursor.fetchone() if not (ircdb.checkCapability(user_id, 'admin') or \ @@ -157,7 +155,7 @@ class Dunno(callbacks.Privmsg): irc.error(msg, 'No dunnos with %r found.' % text) return ids = [str(t[0]) for t in cursor.fetchall()] - s = 'Dunno search for %r (%d found): %s' % \ + s = 'Dunno search for %r (%s found): %s' % \ (text, len(ids), utils.commaAndify(ids)) irc.reply(msg, s) @@ -175,10 +173,10 @@ class Dunno(callbacks.Privmsg): cursor = self.db.cursor() cursor.execute("""SELECT dunno FROM dunnos WHERE id = %s""", id) if cursor.rowcount == 0: - irc.error(msg, 'No dunno found with id #%d' % id) + irc.error(msg, 'No dunno found with id #%s' % id) return dunno = cursor.fetchone()[0] - irc.reply(msg, "Dunno #%d: %r" % (id, dunno)) + irc.reply(msg, "Dunno #%s: %r" % (id, dunno)) Class = Dunno diff --git a/plugins/MoobotFactoids.py b/plugins/MoobotFactoids.py index 9402949cc..ccdc57a05 100644 --- a/plugins/MoobotFactoids.py +++ b/plugins/MoobotFactoids.py @@ -489,7 +489,7 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp): irc.reply(msg, "No factoids by %r found." % author) return keys = [repr(tup[0]) for tup in cursor.fetchall()] - s = "Author search for %r (%d found): %s" % \ + s = "Author search for %r (%s found): %s" % \ (author, len(keys), utils.commaAndify(keys)) irc.reply(msg, s) @@ -509,7 +509,7 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp): irc.reply(msg, "No keys matching %r found." % search) return keys = [repr(tup[0]) for tup in cursor.fetchall()] - s = "Key search for %r (%d found): %s" % \ + s = "Key search for %r (%s found): %s" % \ (search, len(keys), utils.commaAndify(keys)) irc.reply(msg, s) @@ -529,7 +529,7 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp): irc.reply(msg, "No values matching %r found." % search) return keys = [repr(tup[0]) for tup in cursor.fetchall()] - s = "Value search for %r (%d found): %s" % \ + s = "Value search for %r (%s found): %s" % \ (search, len(keys), utils.commaAndify(keys)) irc.reply(msg, s) diff --git a/plugins/Todo.py b/plugins/Todo.py index 0bb7eadf5..8b23e9d56 100644 --- a/plugins/Todo.py +++ b/plugins/Todo.py @@ -286,11 +286,11 @@ class Todo(callbacks.Privmsg): cursor.execute("""SELECT userid, priority FROM todo WHERE id = %s AND active = 1""", id) if cursor.rowcount == 0: - irc.error(msg, 'No note with id %d' % id) + irc.error(msg, 'No note with id %s' % id) return (userid, oldpriority) = cursor.fetchone() if userid != user_id: - irc.error(msg, 'Todo #%d does not belong to you.' % id) + irc.error(msg, 'Todo #%s does not belong to you.' % id) return # If we make it here, we're okay cursor.execute("""UPDATE todo SET priority = %s