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

Method execute

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

Source from the content-addressed store, hash-verified

4330
4331 async execute(
4332 msg: Api.Message,
4333 args: string[],
4334 _prefixes: string[],
4335 ): Promise<void> {
4336 const configManager = await this.getConfigManager();
4337 const config = configManager.getConfig();
4338
4339 if (args.length < 2) {
4340 await this.editMessage(
4341 msg,
4342 `⏱️ <b>当前超时设置:</b>\n\n⏰ 超时时间: <code>${config.timeout} 秒</code>`,
4343 );
4344 return;
4345 }
4346
4347 const timeout = parseInt(args[1]);
4348 requireUser(
4349 !isNaN(timeout) && timeout >= 1 && timeout <= 600,
4350 "超时时间必须在 1 到 600 秒之间",
4351 );
4352
4353 await configManager.updateConfig((cfg) => {
4354 cfg.timeout = timeout;
4355 });
4356
4357 await this.editMessage(msg, `✅ 超时时间已设置为 ${timeout} 秒`);
4358 }
4359}
4360
4361class QuestionFeature extends BaseFeatureHandler {
4362 readonly name = "AI 提问";

Callers

nothing calls this directly

Calls 5

getConfigManagerMethod · 0.80
editMessageMethod · 0.80
requireUserFunction · 0.70
getConfigMethod · 0.45
updateConfigMethod · 0.45

Tested by

no test coverage detected