From 2fb2a6e8cdbed1b8652f8ff7c1b98a8c1b05675a Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 16 Feb 2004 08:30:59 +0000 Subject: [PATCH] Made us not respond in invalidCommand if the factoid isn't found. --- plugins/Factoids.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Factoids.py b/plugins/Factoids.py index 55adaf7f3..95f5e3193 100644 --- a/plugins/Factoids.py +++ b/plugins/Factoids.py @@ -162,7 +162,7 @@ class Factoids(plugins.ChannelDBHandler, callbacks.Privmsg): LIMIT 20""", key) return [t[0] for t in cursor.fetchall()] - def _replyFactoids(self, irc, key, factoids, number=0): + def _replyFactoids(self, irc, key, factoids, number=0, error=False): if factoids: if number: try: @@ -178,7 +178,7 @@ class Factoids(plugins.ChannelDBHandler, callbacks.Privmsg): counter += 1 irc.replies(factoidsS, prefixer='%r could be ' % key, joiner=', or ', onlyPrefixFirst=True) - else: + elif error: irc.error('No factoid matches that key.') def invalidCommand(self, irc, msg, tokens): @@ -187,7 +187,7 @@ class Factoids(plugins.ChannelDBHandler, callbacks.Privmsg): if self.registryValue('replyWhenInvalidCommand', channel): key = ' '.join(tokens) factoids = self._lookupFactoid(channel, key) - self._replyFactoids(irc, key, factoids) + self._replyFactoids(irc, key, factoids, error=False) def whatis(self, irc, msg, args): """[] []