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

Method handleGlobalMode

pangu/pangu.ts:407–439  ·  view source on GitHub ↗
(msg: Api.Message, args: string[])

Source from the content-addressed store, hash-verified

405 text: `🌐 <b>全局模式:</b> ${globalMode ? "✅ 开启" : "❌ 关闭"}`,
406 parseMode: "html"
407 });
408 return;
409 }
410
411 const modeStr = args[2].toLowerCase();
412
413 if (modeStr === "on" || modeStr === "enable" || modeStr === "true") {
414 this.db.data.globalMode = true;
415 await this.db.write();
416 await msg.edit({
417 text: `✅ 全局模式已开启`,
418 parseMode: "html"
419 });
420 } else if (modeStr === "off" || modeStr === "disable" || modeStr === "false") {
421 this.db.data.globalMode = false;
422 await this.db.write();
423 await msg.edit({
424 text: `❌ 全局模式已关闭`,
425 parseMode: "html"
426 });
427 } else {
428 await msg.edit({
429 text: `❌ 无效的参数\n\n使用:<code>${mainPrefix}pangu global on/off</code>`,
430 parseMode: "html"
431 });
432 }
433 }
434
435 // 测试格式化
436 private async handleTest(msg: Api.Message, text: string): Promise<void> {
437 if (!text.trim()) {
438 await msg.edit({
439 text: `❌ 请提供测试文本\n\n使用:<code>${mainPrefix}pangu 你好World123测试</code>`,
440 parseMode: "html"
441 });
442 return;

Callers 1

PanguPluginClass · 0.95

Calls 2

writeMethod · 0.80
editMethod · 0.45

Tested by

no test coverage detected