Unborked a thing.

This commit is contained in:
nya~ 2018-06-21 19:25:12 +01:00 committed by GitHub
parent 63d852f37b
commit 08f1903871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,13 +75,11 @@ class SebiMachine(commands.Bot, LoadConfig, Loggable):
# Load plugins # Load plugins
# Add your cog file name in this list # Add your cog file name in this list
with open(in_here("extensions.txt")) as cog_file: with open(in_here("extensions.txt")) as cog_file:
cogs = cog_file.readlines() cogs = {f'sebimachine.cogs.{c.strip()}' for c in cog_file.readlines()}
for cog in cogs: for cog in cogs:
# Could this just be replaced with `strip()`?
try: try:
cog = cog.replace("\n", "") self.load_extension(cog)
self.load_extension(f"src.cogs.{cog}")
self.logger.info(f"Loaded: {cog}") self.logger.info(f"Loaded: {cog}")
except (ModuleNotFoundError, ImportError) as ex: except (ModuleNotFoundError, ImportError) as ex:
logging.exception(f'Could not load {cog}', exc_info=(type(ex), ex, ex.__traceback__)) logging.exception(f'Could not load {cog}', exc_info=(type(ex), ex, ex.__traceback__))