Browse Source

[commands] Delete module when it does not have a setup function.

pull/294/head
Rapptz 9 years ago
parent
commit
1e9251cfef
  1. 2
      discord/ext/commands/bot.py

2
discord/ext/commands/bot.py

@ -712,6 +712,8 @@ class Bot(GroupMixin, discord.Client):
lib = importlib.import_module(name)
if not hasattr(lib, 'setup'):
del lib
del sys.modules[name]
raise discord.ClientException('extension does not have a setup function')
lib.setup(self)

Loading…
Cancel
Save