[commands] Allow loading cogs from folders.

Internally, instead of using module objects just use the `__module__`
attribute which is the same thing. From preliminary testing this seems
to work fine with both regular one-file-per-cog approaches and the
folder cog approach.

Fixes #126.
This commit is contained in:
Rapptz
2017-04-21 18:57:28 -04:00
parent b05d8790fc
commit b6ac856868
2 changed files with 10 additions and 9 deletions

View File

@@ -155,7 +155,7 @@ class Command:
signature = inspect.signature(callback)
self.params = signature.parameters.copy()
self.checks = kwargs.get('checks', [])
self.module = inspect.getmodule(callback)
self.module = callback.__module__
self.ignore_extra = kwargs.get('ignore_extra', True)
self.instance = None
self.parent = None