Fix slash commands
This commit is contained in:
parent
1a8f69e110
commit
a8ae8fe957
11
index.js
11
index.js
|
@ -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
2
package-lock.json
generated
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue