allow disabling plugins even if they're not installed anymore
This commit is contained in:
parent
82f65b6fee
commit
080c995438
@ -185,16 +185,12 @@ export class SqueebotCLI {
|
|||||||
}),
|
}),
|
||||||
cmd('disable', async (...args: string[]): Promise<void> => {
|
cmd('disable', async (...args: string[]): Promise<void> => {
|
||||||
for (const name of args) {
|
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) {
|
if (!this.bot.config.config.enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.log('Disabling plugin', name);
|
||||||
|
|
||||||
const indx = this.bot.config.config.enabled.indexOf(name);
|
const indx = this.bot.config.config.enabled.indexOf(name);
|
||||||
if (indx > -1) {
|
if (indx > -1) {
|
||||||
this.bot.config.config.enabled.splice(indx, 1);
|
this.bot.config.config.enabled.splice(indx, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user