Created
April 29, 2026 12:31
-
-
Save ayashiiiyo/93b656277b6421363a598ab938aa3467 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let handler = async (m, { command, text, conn }) => { | |
| try { | |
| if (!text) return m.reply(`*Example :* .${command} Apa itu AI`) | |
| m.reply(global.wait) | |
| let cmd = command | |
| let web = false | |
| let image = false | |
| let deep = false | |
| let agent = false | |
| if (cmd.includes('/')) { | |
| let parts = cmd.split('/') | |
| cmd = parts[0] | |
| for (let i of parts.slice(1)) { | |
| if (i === 'websearch') web = true | |
| if (i === 'imagegen') image = true | |
| if (i === 'deep') deep = true | |
| if (i === 'agent') agent = true | |
| } | |
| } | |
| let model | |
| switch (cmd) { | |
| case 'gpt-5.1': | |
| model = 'openai/gpt-5.1-thinking' | |
| break | |
| case 'gpt-5-online': | |
| model = 'openai/gpt-5-chat:online' | |
| break | |
| case 'gpt-5': | |
| model = 'openai/gpt-5-chat' | |
| break | |
| case 'gpt-5-nano': | |
| model = 'openai/gpt-5-nano' | |
| break | |
| case 'gpt-5-mini': | |
| model = 'openai/gpt-5-mini' | |
| break | |
| case 'openai-o1': | |
| model = 'openai/o1' | |
| break | |
| case 'openai-o3': | |
| model = 'openai/o3' | |
| break | |
| case 'openai-o3-mini': | |
| model = 'openai/o3-mini' | |
| break | |
| case 'gpt-4o': | |
| model = 'openai/gpt-4o' | |
| break | |
| case 'openai-o4-mini': | |
| model = 'openai/o4-mini' | |
| break | |
| case 'gpt-4.1-mini': | |
| model = 'openai/gpt-4-1-mini' | |
| break | |
| case 'gpt-4.1-nano': | |
| model = 'openai/gpt-4-1-nano' | |
| break | |
| case 'gpt-5.3': | |
| model = 'openai/gpt-5.3-chat' | |
| break | |
| case 'gpt-5.4': | |
| model = 'openai/gpt-5.4' | |
| break | |
| case 'gpt-5.5': | |
| model = 'openai/gpt-5.5' | |
| break | |
| default: | |
| model = 'openai/gpt-5.3-chat' | |
| break | |
| } | |
| const res = await fetch("https://fgsi.dpdns.org/api/ai/chatgpt", { | |
| method: "POST", | |
| headers: { | |
| "accept": "application/json", | |
| "content-type": "application/json" | |
| }, | |
| body: JSON.stringify({ | |
| apikey: "You Apikey", | |
| model: model, | |
| messages: [ | |
| { | |
| id: "", | |
| role: "user", | |
| parts: [ | |
| { | |
| type: "text", | |
| text: text | |
| } | |
| ] | |
| } | |
| ], | |
| isDeepResearchMode: deep || false, | |
| isWebSearchMode: web || false, | |
| isImageGenerationMode: image || false, | |
| isAgenticMode: agent || false | |
| }) | |
| }) | |
| const data = await res.json() | |
| if (data?.data?.images?.length) { | |
| return conn.sendMessage( | |
| m.chat, | |
| { image: { url: data.data.images[0].url } }, | |
| { quoted: m } | |
| ) | |
| } | |
| m.reply(data?.data?.text) | |
| } catch (e) { | |
| m.reply(e.message) | |
| } | |
| } | |
| handler.help = [ | |
| 'gpt-5.1','gpt-5-online','gpt-5','gpt-5-nano','gpt-5-mini', | |
| 'openai-o1','openai-o3','openai-o3-mini','gpt-4o','openai-o4-mini', | |
| 'gpt-4.1-mini','gpt-4.1-nano','gpt-5.3','gpt-5.4','gpt-5.5' | |
| ] | |
| handler.tags = ['ai'] | |
| handler.command = /^(gpt-5\.1|gpt-5-online|gpt-5|gpt-5-nano|gpt-5-mini|openai-o1|openai-o3|openai-o3-mini|gpt-4o|openai-o4-mini|gpt-4\.1-mini|gpt-4\.1-nano|gpt-5\.3|gpt-5\.4|gpt-5\.5)(\/(websearch|imagegen|deep|agent))*$/i | |
| export default handler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment