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

Method execute

ai/ai.ts:4203–4236  ·  view source on GitHub ↗
(
    msg: Api.Message,
    args: string[],
    _prefixes: string[],
  )

Source from the content-addressed store, hash-verified

4201
4202 async execute(
4203 msg: Api.Message,
4204 args: string[],
4205 _prefixes: string[],
4206 ): Promise<void> {
4207 const configManager = await this.getConfigManager();
4208 const config = configManager.getConfig();
4209
4210 if (args.length < 2) {
4211 await this.showTelegraphStatus(msg, config);
4212 return;
4213 }
4214
4215 const action = args[1].toLowerCase();
4216 if (action === "on") {
4217 await this.enableTelegraph(msg, configManager);
4218 return;
4219 }
4220 if (action === "off") {
4221 await this.disableTelegraph(msg, configManager);
4222 return;
4223 }
4224 if (action === "limit") {
4225 requireUser(args.length >= 3, "参数格式错误");
4226 await this.setTelegraphLimit(msg, args, configManager);
4227 return;
4228 }
4229 if (action === "del") {
4230 requireUser(args.length >= 3, "参数格式错误");
4231 await this.deleteTelegraphItem(msg, args, configManager);
4232 return;
4233 }
4234 await this.showTelegraphStatus(msg, config);
4235 }
4236
4237 private async showTelegraphStatus(
4238 msg: Api.Message,
4239 config: DB,

Callers

nothing calls this directly

Calls 8

showTelegraphStatusMethod · 0.95
enableTelegraphMethod · 0.95
disableTelegraphMethod · 0.95
setTelegraphLimitMethod · 0.95
deleteTelegraphItemMethod · 0.95
getConfigManagerMethod · 0.80
requireUserFunction · 0.70
getConfigMethod · 0.45

Tested by

no test coverage detected