3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

commands: only allow loading plugins that aren't already loaded

This commit is contained in:
James Lu 2015-09-27 12:12:58 -07:00
parent 38a350a5f8
commit 5aeaac0394

View File

@ -216,6 +216,9 @@ def load(irc, source, args):
except IndexError:
irc.msg(irc.called_by, "Error: Not enough arguments. Needs 1: plugin name.")
return
if name in world.plugins:
irc.msg(irc.called_by, "Error: %r is already loaded." % name)
return
try:
world.plugins[name] = pl = __import__(name)
except ImportError as e: