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

Function handleGeminiRequest

outdated/gemini/gemini.ts:1666–1909  ·  view source on GitHub ↗
(msg: Api.Message)

Source from the content-addressed store, hash-verified

1664}
1665
1666async function handleGeminiRequest(msg: Api.Message): Promise<void> {
1667 const [, ...args] = msg.message.slice(1).split(" ");
1668 const subCommand = args[0];
1669 const subArgs = args.slice(1);
1670
1671 try {
1672
1673 switch (subCommand) {
1674 case "search":
1675 await handleSearch(msg, subArgs);
1676 return;
1677 case "image":
1678 await handleImage(msg, subArgs);
1679 return;
1680 case "tts":
1681 await handleTTS(msg, subArgs);
1682 return;
1683 case "audio":
1684 await handleAudio(msg, subArgs);
1685 return;
1686 case "searchaudio":
1687 await handleSearchAudio(msg, subArgs);
1688 return;
1689 case "settings":
1690 await handleSettings(msg);
1691 return;
1692 case "model":
1693 await handleModel(msg, subArgs);
1694 return;
1695 case "ttsvoice":
1696 await handleTTSVoice(msg, subArgs);
1697 return;
1698 case "context":
1699 if (subArgs[0] === "clear") {
1700 await handleContextClear(msg);
1701 } else if (subArgs[0] === "on") {
1702 ConfigManager.set(CONFIG_KEYS.GEMINI_CONTEXT_ENABLED, "on");
1703 await msg.edit({ text: "✅ 对话上下文已启用" });
1704 } else if (subArgs[0] === "off") {
1705 ConfigManager.set(CONFIG_KEYS.GEMINI_CONTEXT_ENABLED, "off");
1706 await msg.edit({ text: "✅ 对话上下文已禁用" });
1707 } else if (subArgs[0] === "show") {
1708 await handleContextShow(msg);
1709 } else {
1710 await msg.edit({ text: "❌ 用法: gemini context [on|off|clear|show]" });
1711 }
1712 return;
1713 case "telegraph":
1714 await handleTelegraph(msg, subArgs);
1715 return;
1716 case "collapse":
1717 await handleCollapse(msg, subArgs);
1718 return;
1719 case "prompt":
1720 await handlePrompt(msg, subArgs);
1721 return;
1722 }
1723

Callers

nothing calls this directly

Calls 15

handleSearchFunction · 0.85
handleImageFunction · 0.85
handleTTSFunction · 0.85
handleAudioFunction · 0.85
handleSearchAudioFunction · 0.85
handleSettingsFunction · 0.85
handleModelFunction · 0.85
handleTTSVoiceFunction · 0.85
handleContextClearFunction · 0.85
handleContextShowFunction · 0.85
handleTelegraphFunction · 0.85
handleCollapseFunction · 0.85

Tested by

no test coverage detected