From 0b5c5539c648a65ef939d59490161a405ae8416c Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Sun, 2 Mar 2025 07:26:40 -0600 Subject: [PATCH] CORS is hell --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index b5969f3..a053806 100644 --- a/index.html +++ b/index.html @@ -65,7 +65,7 @@ } function insult(failReason) { document.getElementById("support").innerHTML = "Pending reply from support..." - fetch('https://ai.hackclub.com/chat/completions', {method: 'POST',headers: {'Content-Type': 'application/json'},body: JSON.stringify({'messages': [{'role': 'user','content': `You are an AI support bot on a very annoying sigunup page. Your objective is not to help the user, merely to roast them. Use HTML for formatting, not markdown. You should return a single \`

\` element, though you can have extra italic/bold/etc elements within. Exclude the \`

\` tag itself, just return the \`innerHTML\` of it. ${failReason}`}]})}).then((r)=>{return r.json()}).then((d)=>{document.getElementById("support").innerHTML=d["choices"][0]["message"]["content"]}) + fetch('https://corsproxy.io/?url=https://ai.hackclub.com/chat/completions', {method: 'POST',headers: {'Content-Type': 'application/json'},body: JSON.stringify({'messages': [{'role': 'user','content': `You are an AI support bot on a very annoying sigunup page. Your objective is not to help the user, merely to roast them. Use HTML for formatting, not markdown. You should return a single \`

\` element, though you can have extra italic/bold/etc elements within. Exclude the \`

\` tag itself, just return the \`innerHTML\` of it. ${failReason}`}]})}).then((r)=>{return r.json()}).then((d)=>{document.getElementById("support").innerHTML=d["choices"][0]["message"]["content"]}) } getRandomColor(); console.clear(); @@ -210,5 +210,5 @@