diff --git a/dr_botzo/ircbot/bot.py b/dr_botzo/ircbot/bot.py index de7ab71..607f70f 100644 --- a/dr_botzo/ircbot/bot.py +++ b/dr_botzo/ircbot/bot.py @@ -646,18 +646,19 @@ class IRCBot(irc.client.SimpleIRCClient): dest = ircbotlib.reply_destination_for_event(event) + unloaded = False for path, plugin in self.plugins: if plugin_path == path: + unloaded = True self.plugins.remove((path, plugin)) plugin.stop() del plugin del sys.modules[plugin_path] self.privmsg(dest, "Plugin '{0:s}' unloaded.".format(plugin_path)) - return - # guess it was never loaded - self.privmsg(dest, "Plugin '{0:s}' is not loaded.".format(plugin_path)) + if not unloaded: + self.privmsg(dest, "Plugin '{0:s}' is not loaded.".format(plugin_path)) def privmsg(self, target, text): """Send a PRIVMSG command.