Skip to content

Commit 013af1a

Browse files
committed
Force removal of plugin from config
1 parent 59c466c commit 013af1a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cogs/plugins.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,13 @@ async def plugin_remove(self, ctx, *, plugin_name: str):
191191
info = self.registry[plugin_name]
192192
plugin_name = info['repository'] + '/' + plugin_name
193193
if plugin_name in self.bot.config.plugins:
194-
username, repo, name = self.parse_plugin(plugin_name)
195-
self.bot.unload_extension(
196-
f'plugins.{username}-{repo}.{name}.{name}'
197-
)
194+
try:
195+
username, repo, name = self.parse_plugin(plugin_name)
196+
self.bot.unload_extension(
197+
f'plugins.{username}-{repo}.{name}.{name}'
198+
)
199+
except:
200+
pass
198201

199202
self.bot.config.plugins.remove(plugin_name)
200203

0 commit comments

Comments
 (0)