This commit is contained in:
derpystuff 2023-08-08 23:02:25 +02:00
parent 317613923f
commit 77ca289d1e

View file

@ -22,12 +22,16 @@ module.exports = {
context.triggerTyping(); context.triggerTyping();
if(!args.text) return editOrReply(context, {embeds:[createEmbed("warning", context, `Missing Parameter (text).`)]}) if(!args.text) return editOrReply(context, {embeds:[createEmbed("warning", context, `Missing Parameter (text).`)]})
try{ try{
let res = await superagent.get(`${process.env.AI_SERVER}/chat`) let res = await superagent.post(`${process.env.AI_SERVER}/chatgpt`)
.query({ .set({
prompt: args.text 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, { 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: { footer: {
text: `This information may be inaccurate or biased • ${context.application.name}` text: `This information may be inaccurate or biased • ${context.application.name}`
} }