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

2
package-lock.json generated
View file

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

View file

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