Upload files to "/"
11/08/2023
This commit is contained in:
parent
85419ab630
commit
dd8127052a
2 changed files with 75 additions and 0 deletions
32
notclyde.js
Normal file
32
notclyde.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
import { default as log } from "../util/log.js";
|
||||
import * as action from "../util/discordAction.js";
|
||||
import { Configuration, OpenAIApi } from "openai"; // npm i openai
|
||||
import readline from "readline";
|
||||
|
||||
const configuration = new Configuration({
|
||||
organization: "org-0nmrFWw6wSm6xIJXSbx4FpTw",// platform.openai.com/account/org-settings
|
||||
apiKey: "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", // platform.openai.com/account/api-keys
|
||||
});
|
||||
const openai = new OpenAIApi(configuration);
|
||||
|
||||
const prefix = process.env.PREFIX;
|
||||
|
||||
export default {
|
||||
name: "notclyde",
|
||||
description: "ask a chatbot that is Powered by OpenAI:tm: whatever the fk you want",
|
||||
arguments: "message",
|
||||
execute(message, args) {
|
||||
const msgnoprefix = message.content.slice(prefix.length + this.name.length);
|
||||
openai
|
||||
.createChatCompletion({
|
||||
model: "gpt-3.5-turbo",
|
||||
messages: [{ role: "user", content: message.content }],
|
||||
})
|
||||
.then((res) => {
|
||||
action.reply(message, res.data.choices[0].message.content);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue