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

Method constructor

music/music.ts:1845–1889  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1843
1844 async execute(msg: Api.Message): Promise<void> {
1845 const args = msg.text?.split(" ").slice(1) || [];
1846
1847 if (!args.length || args[0] === "help") {
1848 // 编辑原消息而不是回复
1849 await msg.edit({ text: this.description, parseMode: "html" });
1850 return;
1851 }
1852
1853 const command = args[0].toLowerCase();
1854
1855 switch (command) {
1856 case "config":
1857 await this.handleConfig(msg);
1858 break;
1859
1860 case "set":
1861 await this.handleSet(msg, args.slice(1));
1862 break;
1863
1864 case "clear":
1865 await this.handleClear(msg);
1866 break;
1867
1868 default:
1869 await this.handleDownload(msg, args.join(" "));
1870 }
1871 }
1872
1873 private async handleConfig(msg: Api.Message): Promise<void> {
1874 const cookie = await ConfigManager.get(CONFIG.KEYS.COOKIE);
1875 const proxy = await ConfigManager.get(CONFIG.KEYS.PROXY);
1876 const apiKey = await ConfigManager.get(CONFIG.KEYS.API);
1877 const baseUrl = await ConfigManager.get(CONFIG.KEYS.BASE_URL);
1878 const model = await ConfigManager.get(CONFIG.KEYS.MODEL);
1879 const quality = await ConfigManager.get(CONFIG.KEYS.AUDIO_QUALITY);
1880
1881 const status = `⚙️ <b>当前配置</b>
1882
1883${cookie ? "✅" : "⚪"} <b>Cookie:</b> ${cookie ? "已设置" : "未设置"}
1884${proxy ? "✅" : "⚪"} <b>代理:</b> ${proxy ? Utils.escape(proxy) : "未配置"}
1885${apiKey ? "✅" : "⚪"} <b>AI搜索:</b> ${apiKey ? "已启用" : "未配置"}
1886🎚️ <b>音频质量:</b> <code>${Utils.escape(quality || "自动(最佳可用)")}</code>
1887🔧 <b>Gemini Base URL:</b> <code>${Utils.escape(baseUrl || "")}</code>
1888🧠 <b>Gemini Model:</b> <code>${Utils.escape(model || "")}</code>
1889
1890💡 <i>使用 <code>${commandName} set [配置项] [值]</code> 修改配置</i>`;
1891
1892 // 编辑原消息而不是回复

Callers

nothing calls this directly

Calls 1

cleanCacheMethod · 0.80

Tested by

no test coverage detected