From 080c995438761b976208dd3cc4d913a378d88249 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Sat, 2 Oct 2021 20:30:13 +0300 Subject: [PATCH] allow disabling plugins even if they're not installed anymore --- src/cli.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 8493df8..92e44ee 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -185,16 +185,12 @@ export class SqueebotCLI { }), cmd('disable', async (...args: string[]): Promise => { for (const name of args) { - if (!this.bot.pluginManager.getAvailableByName(name)) { - throw new Error(`No such plugin "${name}" found.`); - } - - logger.log('Disabling plugin', name); - if (!this.bot.config.config.enabled) { return; } + logger.log('Disabling plugin', name); + const indx = this.bot.config.config.enabled.indexOf(name); if (indx > -1) { this.bot.config.config.enabled.splice(indx, 1);