Skip to content

Commit

Permalink
feat: Update decode.js to display decoded user information in an embed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrewstech committed Jul 29, 2024
1 parent 5c6e18a commit dae3285
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion commands/decode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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] });

Expand Down

0 comments on commit dae3285

Please sign in to comment.