updating for openai

This commit is contained in:
John Facey
2023-01-04 02:16:15 -06:00
parent e32c3bd207
commit c6f8f646da
5 changed files with 1508 additions and 3 deletions

21
commands/chat.js Normal file
View File

@@ -0,0 +1,21 @@
var libFlayer = require("../libFlayer.js");
module.exports = {
name: 'chat',
description: 'Chat',
async execute(message, args) {
if (args.length < 1) {
message.reply(`Please use in !chat [chat query]`);
return;
}
try {
var question = encodeURIComponent(args.join(" "));
var response = await libFlayer.getChat(question);
message.reply(`${message.author.username} ${response}`);
} catch (err) {
//message.reply(err.toString());
}
}
};