From 77ca289d1edc4702789dcbc4b17acd8ef9694af6 Mon Sep 17 00:00:00 2001 From: derpystuff <3515180-derpystuff@users.noreply.gitlab.com> Date: Tue, 8 Aug 2023 23:02:25 +0200 Subject: [PATCH] free gpt --- commands/message/fun/chat.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/commands/message/fun/chat.js b/commands/message/fun/chat.js index 26e2504..516d5c2 100644 --- a/commands/message/fun/chat.js +++ b/commands/message/fun/chat.js @@ -22,12 +22,16 @@ module.exports = { context.triggerTyping(); if(!args.text) return editOrReply(context, {embeds:[createEmbed("warning", context, `Missing Parameter (text).`)]}) try{ - let res = await superagent.get(`${process.env.AI_SERVER}/chat`) - .query({ - prompt: args.text - }) + let res = await superagent.post(`${process.env.AI_SERVER}/chatgpt`) + .set({ + Authorization: process.env.AI_SERVER_KEY + }) + .send({ + prompt: "You are a friendly chat bot designed to help people.", + input: [args.text] + }) return editOrReply(context, {embeds:[createEmbed("default", context, { - description: codeblock("ansi", ["šŸ‘¤ " + format(args.text, "cyan") + "\nšŸ¤– " + res.body.text]), + description: codeblock("ansi", ["šŸ‘¤ " + format(args.text, "cyan") + "\nšŸ¤– " + res.body.output]), footer: { text: `This information may be inaccurate or biased • ${context.application.name}` }