Skip to content

Commit 630d3db

Browse files
committed
Potentially fix plugin update command
1 parent a99c358 commit 630d3db

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cogs/plugins.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ async def load_plugin(self, username, repo, plugin_name):
126126
try:
127127
self.bot.load_extension(ext)
128128
except commands.ExtensionError as exc:
129-
raise DownloadError('Invalid plugin.') from exc
129+
raise DownloadError('Invalid plugin') from exc
130130
else:
131131
msg = f'Loaded plugins.{username}-{repo}.{plugin_name}'
132132
logger.info(info(msg))
@@ -250,8 +250,7 @@ async def plugin_update(self, ctx, *, plugin_name: str):
250250
if output != 'Already up to date.':
251251
# repo was updated locally, now perform the cog reload
252252
ext = f'plugins.{username}-{repo}.{name}.{name}'
253-
importlib.reload(importlib.import_module(ext))
254-
253+
self.bot.unload_extension(ext)
255254
try:
256255
await self.load_plugin(username, repo, name)
257256
except DownloadError as exc:

0 commit comments

Comments
 (0)