Added cards to the leveling system, and fixed some bugs. Note that node-fetch has been bumped DOWN to v2 to avoid EMS format

This commit is contained in:
ION606
2022-12-26 14:40:50 -08:00
parent 5292bd8a09
commit ebb34c9f89
16 changed files with 240 additions and 96 deletions
+11 -1
View File
@@ -24,7 +24,8 @@ async function messageExists(message) {
async function getResponse(convo, bot) {
const response = await bot.openai.createCompletion({
try {
const response = await bot.openai.createCompletion({
model: "text-davinci-002",
prompt: convo,
temperature: 0.9,
@@ -36,6 +37,11 @@ async function getResponse(convo, bot) {
});
return response;
} catch (err) {
console.error(err);
return false;
}
}
async function convoManager(clientinp, bot, message) {
@@ -78,6 +84,10 @@ async function convoManager(clientinp, bot, message) {
//Get the response
const r = await getResponse(convo, bot);
if (!r) {
return message.channel.send("Uh oh! There's been an error! Please contact support \:[");
}
let response = r.data.choices[0].text;
convo += (response + '\n');