Update notclyde.js

This commit is contained in:
ayeuhugyu 2023-11-08 12:22:53 -08:00
parent a6d91f2eb1
commit 2d0adeedcb

View file

@ -18,6 +18,7 @@ export default {
execute(message, args) { execute(message, args) {
const prompt = message.content.slice(prefix.length + this.name.length); const prompt = message.content.slice(prefix.length + this.name.length);
const sent = action.reply(message, `generating response for \`${prompt}\``) const sent = action.reply(message, `generating response for \`${prompt}\``)
message.channel.startTyping()
openai openai
.createChatCompletion({ .createChatCompletion({
model: "gpt-3.5-turbo", model: "gpt-3.5-turbo",
@ -25,6 +26,7 @@ export default {
}) })
.then((res) => { .then((res) => {
action.edit(sent, res.data.choices[0].message.content); action.edit(sent, res.data.choices[0].message.content);
message.channel.stopTyping()
}) })
.catch((e) => { .catch((e) => {
console.log(e); console.log(e);