diff --git a/app.js b/app.js index d266e54..b880122 100644 --- a/app.js +++ b/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 diff --git a/libs/openAi.js b/libs/openAi.js index 4541363..24bafc7 100644 --- a/libs/openAi.js +++ b/libs/openAi.js @@ -32,7 +32,6 @@ async function answerQuestion(query) { addToLogs("--> error : " + err); }) - console.log(response); return response; } diff --git a/register-commands.js b/register-commands.js index 6c426f6..3945eac 100644 --- a/register-commands.js +++ b/register-commands.js @@ -12,6 +12,11 @@ const commands = [ required: true, }, ], + }, + + { + name : 'info', + description : 'utilise pas cette commande fdp', } ];