From 08618e2be27fbc38f039dee25f5fcd573079ad9f Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 15 Jun 2023 19:07:16 -0400 Subject: [PATCH] Experimental generating content embed --- functions.js | 8 ++++++++ slash-commands/chat.js | 1 + slash-commands/dalle.js | 1 + 3 files changed, 10 insertions(+) diff --git a/functions.js b/functions.js index 54c1da4..df69ff9 100644 --- a/functions.js +++ b/functions.js @@ -393,6 +393,14 @@ const functions = { .setDescription(`**Prompt**\n${prompt}\n\n**Response**\n${response}`) .setFooter({ text: `This prompt used ${usage.tokens} tokens for a cost of ${usage.usdc}ยข` }) return { embeds: [gptEmbed] }; + }, + generatingResponse() { + const embed = new Discord.MessageEmbed() + .setAuthor({ name: "NodBot powered by OpenAI", iconURL: "https://assets.vfsh.dev/openai-logos/PNGs/openai-logomark.png" }) + .setImage("https://tenor.com/view/sucks-gif-4499658") + .setDescription("Generating a response, please stand by.") + .setFooter({ text: "Ligma balls" }); + return { embeds: [embed] }; } }, collect: { diff --git a/slash-commands/chat.js b/slash-commands/chat.js index 2418a7b..ed21ea5 100644 --- a/slash-commands/chat.js +++ b/slash-commands/chat.js @@ -12,6 +12,7 @@ module.exports = { ), async execute(interaction) { await interaction.deferReply(); + await interaction.editReply(fn.embeds.generatingResponse()); const userPrompt = interaction.options.getString("prompt"); const response = await fn.openAI.chatPrompt(userPrompt).catch(e => console.error(e)); const responseText = response.choices[0].text.slice(2); diff --git a/slash-commands/dalle.js b/slash-commands/dalle.js index 7636c1a..029b066 100644 --- a/slash-commands/dalle.js +++ b/slash-commands/dalle.js @@ -23,6 +23,7 @@ module.exports = { async execute(interaction) { try { await interaction.deferReply(); + await interaction.editReply(fn.embeds.generatingResponse()); const userPrompt = interaction.options.getString("prompt"); const size = interaction.options.getString("size") ? interaction.options.getString("size") : "512x512";