commit
This commit is contained in:
parent
4afa276479
commit
614b7afc08
3 changed files with 15 additions and 2 deletions
11
app.js
11
app.js
|
@ -155,7 +155,12 @@ client.on('interactionCreate', async interaction => {
|
|||
|
||||
if (interaction.commandName === 'gptrequest') {
|
||||
answerQuestion(interaction.options.get('question').value).then((res) => {
|
||||
const embed = new discord.EmbedBuilder().setTitle("test").setDescription(res.data.choices[0].message.content);
|
||||
const embed = new discord.EmbedBuilder()
|
||||
.setColor(0xFABBDE)
|
||||
.setAuthor({ name : "Reply to : " + interaction.member.user.username, iconURL : "https://cdn.discordapp.com/avatars/"+interaction.member.user.id+"/"+interaction.member.user.avatar+".jpeg"})
|
||||
.setTitle("Question : " + interaction.options.get('question').value)
|
||||
.setDescription(res.data.choices[0].message.content)
|
||||
.setFooter({ text : "Powered by OpenAI https://www.openai.com/", iconURL : "https://seeklogo.com/images/O/open-ai-logo-8B9BFEDC26-seeklogo.com.png" });
|
||||
|
||||
console.log('[Discord] Sent answer to : ' + interaction.options.get('question').value);
|
||||
addToLogs('[Discord] Sent answer to : ' +interaction.options.get('question').value);
|
||||
|
@ -169,6 +174,10 @@ client.on('interactionCreate', async interaction => {
|
|||
console.log('[Discord] Generating answer to : ' + interaction.options.get('question').value);
|
||||
addToLogs('[Discord] Generating answer to : ' + interaction.options.get('question').value);
|
||||
}
|
||||
|
||||
else if (interaction.commandName === 'info') {
|
||||
console.log(interaction)
|
||||
}
|
||||
});
|
||||
|
||||
//bot launch
|
||||
|
|
|
@ -32,7 +32,6 @@ async function answerQuestion(query) {
|
|||
addToLogs("--> error : " + err);
|
||||
})
|
||||
|
||||
console.log(response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,11 @@ const commands = [
|
|||
required: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
name : 'info',
|
||||
description : 'utilise pas cette commande fdp',
|
||||
}
|
||||
];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue