bot.command({
name:"ask",
code:`$djsEval[
const Discord = require("discord.js");
const axios = require("axios");
async function respondToMessage(msg) {
const response = await axios.post("https://api.openai.com/v1/engines/davinci/jobs", [{
prompt: msg.message,
max_tokens: 100,
n: 1,
stop: null,
temperature: 0.5,
}], {
headers: {
"Authorization": "SECRET CODE"
}
});
msg.reply(response.data.choices[0].text);
}
;
;yes]`})
I have this aoi.js code but api doesn't send reply. I tried the code in normal discord.js but doesn't work too.