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

Method handleConfig

music/music.ts:1920–1941  ·  view source on GitHub ↗
(msg: Api.Message)

Source from the content-addressed store, hash-verified

1918<code>${commandName} set quality 192k</code>
1919<code>${commandName} set quality 0</code> (VBR 最高质量)`,
1920 parseMode: "html",
1921 });
1922 return;
1923 }
1924
1925 const [rawKey, ...valueParts] = args;
1926 let value = valueParts.join(" ");
1927
1928 // 支持 none/clear/空 来清空配置
1929 const clearKeywords = ["none", "clear", "空", "取消"];
1930 if (clearKeywords.includes(value.toLowerCase().trim())) {
1931 value = "";
1932 }
1933
1934 // 将用户友好键映射为内部存储键
1935 const keyMap: Record<string, string> = {
1936 cookie: CONFIG.KEYS.COOKIE,
1937 proxy: CONFIG.KEYS.PROXY,
1938 api_key: CONFIG.KEYS.API,
1939 base_url: CONFIG.KEYS.BASE_URL,
1940 baseurl: CONFIG.KEYS.BASE_URL,
1941 model: CONFIG.KEYS.MODEL,
1942 quality: CONFIG.KEYS.AUDIO_QUALITY,
1943 };
1944 const normalized = keyMap[rawKey.toLowerCase()] || rawKey;

Callers 1

executeMethod · 0.95

Calls 3

getMethod · 0.45
escapeMethod · 0.45
editMethod · 0.45

Tested by

no test coverage detected