From 6491897e9330911ff1d39816c5a147fb8ee3b93b Mon Sep 17 00:00:00 2001 From: kwzrd Date: Mon, 23 Mar 2020 16:46:17 +0100 Subject: Deseasonify: remove `load_extensions` method This is unused and no longer necessary, as all extensions load only once: on start-up, in `__main__.py`. --- bot/bot.py | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'bot/bot.py') diff --git a/bot/bot.py b/bot/bot.py index c6ec3357..ab196bc1 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -2,8 +2,7 @@ import asyncio import contextlib import logging import socket -from traceback import format_exc -from typing import List, Optional +from typing import Optional import async_timeout import discord @@ -27,23 +26,6 @@ class SeasonalBot(commands.Bot): connector=TCPConnector(resolver=AsyncResolver(), family=socket.AF_INET) ) - def load_extensions(self, exts: List[str]) -> None: - """Unload all current extensions, then load the given extensions.""" - # Unload all cogs - extensions = list(self.extensions.keys()) - for extension in extensions: - if extension not in ["bot.branding", "bot.help"]: # We shouldn't unload the manager and help. - self.unload_extension(extension) - - # Load in the list of cogs that was passed in here - for extension in exts: - cog = extension.split(".")[-1] - try: - self.load_extension(extension) - log.info(f'Successfully loaded extension: {cog}') - except Exception as e: - log.error(f'Failed to load extension {cog}: {repr(e)} {format_exc()}') - async def send_log(self, title: str, details: str = None, *, icon: str = None) -> None: """Send an embed message to the devlog channel.""" devlog = self.get_channel(Channels.devlog) -- cgit v1.2.3