Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit dae3285

Browse files
author
andrewstech
committed
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.
1 parent 5c6e18a commit dae3285

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

commands/decode.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ module.exports = {
3737

3838
const decoded = await DecryptPayload(key);
3939

40+
const userd = JSON.parse(decoded);
41+
42+
const username = userd.username;
43+
const email = userd.email;
44+
const user_id = userd.user_id;
45+
4046
const embed = new EmbedBuilder()
4147
.setTitle("User Information")
4248
.setColor("#0096ff")
43-
.setDescription(`**Key:** ${key}\n**Decoded:** ${JSON.stringify(decoded)}`);
49+
.setDescription(`\n**Decoded:** \n\nUsername: ${username}\nEmail: ${email}\nUser ID: ${user_id}`);
4450

4551
await interaction.editReply({ embeds: [embed] });
4652

0 commit comments

Comments
 (0)