Improved module loading
This commit is contained in:
parent
ed1cb24e9c
commit
762ae5fd4d
@ -75,7 +75,11 @@ class ModuleService(ModuleServiceABC, commands.Cog, metaclass=_MetaCogABC):
|
|||||||
module_types = self._modules.where(lambda m: issubclass(m, t))
|
module_types = self._modules.where(lambda m: issubclass(m, t))
|
||||||
modules = List(t)
|
modules = List(t)
|
||||||
for module_type in module_types:
|
for module_type in module_types:
|
||||||
modules.append(self._services.get_service(module_type))
|
module = self._services.get_service(module_type)
|
||||||
|
if module is None:
|
||||||
|
self._logger.warn(__name__, f'Module {module_type} not found in services!')
|
||||||
|
break
|
||||||
|
modules.append(module)
|
||||||
|
|
||||||
return modules.order_by(lambda m: m.get_priority(t))
|
return modules.order_by(lambda m: m.get_priority(t))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user