MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / removeCustomRuleById

Method removeCustomRuleById

autodelcmd/autodelcmd.ts:640–654  ·  view source on GitHub ↗
(ruleId: string)

Source from the content-addressed store, hash-verified

638
639 const ruleIndex = this.config.customRules.findIndex(r => r.id === ruleId);
640
641 if (ruleIndex === -1) {
642 return { success: false };
643 }
644
645 const removedRule = this.config.customRules[ruleIndex];
646 this.config.customRules.splice(ruleIndex, 1);
647
648 await this.saveConfig();
649 return { success: true, removedRule };
650 }
651
652 public getCustomRules(): CommandRule[] {
653 return this.config.customRules || [];
654 }
655
656 public getCustomRulesByCommand(command?: string): CommandRule[] {
657 const rules = this.getCustomRules();

Callers 1

handleRemoveRuleMethod · 0.80

Calls 1

saveConfigMethod · 0.95

Tested by

no test coverage detected