ZeroBot should be aware of protocol and feature modules that are available to load, but have not yet been loaded. This is strongly tied to issue #11, and will likely need to be resolved first.
I believe that this could be done rather simply with importlib.util.find_spec, as shown in this example. It could be wrapped up something like the following:
# Possibly in ZeroBot.module somewhere, or in Core
def feature_available(self, module_id: str) -> bool:
return importlib.util.find_spec(f'ZeroBot.feature.{module_id}') is not None
Be sure to raise NoSuchModule exceptions where appropriate throughout Core; it should accompany anywhere that already raises ModuleNotLoaded for the most part.
ZeroBot should be aware of protocol and feature modules that are available to load, but have not yet been loaded. This is strongly tied to issue #11, and will likely need to be resolved first.
I believe that this could be done rather simply with
importlib.util.find_spec
, as shown in this example. It could be wrapped up something like the following:Be sure to raise
NoSuchModule
exceptions where appropriate throughout Core; it should accompany anywhere that already raisesModuleNotLoaded
for the most part.