From dae32850d3de26ff96b6238760ce5a483321ea13 Mon Sep 17 00:00:00 2001 From: andrewstech Date: Mon, 29 Jul 2024 19:31:21 +0000 Subject: [PATCH] feat: Update decode.js to display decoded user information in an embed This commit updates the `decode.js` file to display the decoded user information in an embed. The code now parses the decoded payload and extracts the username, email, and user ID. It then creates an embed with the extracted information and sends it as a reply to the interaction. --- commands/decode.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands/decode.js b/commands/decode.js index f871f02..595c608 100644 --- a/commands/decode.js +++ b/commands/decode.js @@ -37,10 +37,16 @@ module.exports = { const decoded = await DecryptPayload(key); + const userd = JSON.parse(decoded); + + const username = userd.username; + const email = userd.email; + const user_id = userd.user_id; + const embed = new EmbedBuilder() .setTitle("User Information") .setColor("#0096ff") - .setDescription(`**Key:** ${key}\n**Decoded:** ${JSON.stringify(decoded)}`); + .setDescription(`\n**Decoded:** \n\nUsername: ${username}\nEmail: ${email}\nUser ID: ${user_id}`); await interaction.editReply({ embeds: [embed] });