Fix slash commands

This commit is contained in:
Christopher Cookman 2024-07-02 17:54:09 -06:00
parent 1a8f69e110
commit a8ae8fe957
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42
3 changed files with 7 additions and 8 deletions

View file

@ -1,11 +1,9 @@
const config = require("./config.json");
const lang = require("./lang.json");
const {
Configuration,
OpenAIApi
} = require("openai");
const openai = new OpenAIApi(new Configuration({
apiKey: config.openai.key
const OpenAI = require("openai");
const openai = new OpenAI.OpenAIApi(new OpenAI.Configuration({
//apiKey: config.openai.key,
basePath: "http://127.0.0.1:6969"
}));
const Discord = require("discord.js");
const {
@ -271,6 +269,7 @@ client.on('messageCreate', async (message) => {
});
// Send the message to OpenAI
await openai.createChatCompletion({
stream: false,
model: sessions[message.channelId].model,
messages: sessions[message.channelId].messages
}).then((data) => {

2
package-lock.json generated
View file

@ -10,7 +10,7 @@
"license": "GPL-3.0-or-later",
"dependencies": {
"colors": "^1.4.0",
"discord.js": "^14.7.1",
"discord.js": "14.14.1",
"openai": "^3.2.1",
"readline": "^1.3.0"
}

View file

@ -10,7 +10,7 @@
"license": "GPL-3.0-or-later",
"dependencies": {
"colors": "^1.4.0",
"discord.js": "^14.7.1",
"discord.js": "14.14.1",
"openai": "^3.2.1",
"readline": "^1.3.0"
}