From 99d996818b80582cc9ec7c77091dceec7364ac99 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Thu, 2 Oct 2025 02:27:39 -0600 Subject: [PATCH] Add lookup as well --- interactions/commands/lookup.js | 61 +++++++++++++++++---------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/interactions/commands/lookup.js b/interactions/commands/lookup.js index 0015cc5..dfac618 100644 --- a/interactions/commands/lookup.js +++ b/interactions/commands/lookup.js @@ -1,36 +1,39 @@ const path = require('path'); const execute = async (interaction, db, client) => { - if (!interaction.isCommand()) return; - await interaction.deferReply({ ephemeral: true }).catch(console.error); - interaction.options.getUser("user").id - db.get("SELECT * FROM badActors WHERE id = ?", [interaction.options.getUser("user").id], async (err, row) => { - if (row) { - const embed = { - title: "Bad Actor Found", - description: `User <@${row.id}> is in the bad actors list.`, - fields: [ - { name: "Reported By", value: `<@${row.reportedBy}>`, inline: true }, - { name: "Comment", value: row.comment || "No comment provided", inline: false }, - { name: "Timestamp", value: ``, inline: true } - ], - color: 0x00ff00 - }; + if (!interaction.isCommand()) return; + await interaction.deferReply({ ephemeral: true }).catch(console.error); + interaction.options.getUser("user").id + db.get("SELECT * FROM badActors WHERE id = ?", [interaction.options.getUser("user").id], async (err, row) => { + if (row) { + const embed = { + title: "Bad Actor Found", + description: `User <@${row.id}> is in the bad actors list.`, + fields: [ + { name: "Reported By", value: `<@${row.reportedBy}>`, inline: true }, + { name: "Comment", value: row.comment || "No comment provided", inline: false }, + { name: "Timestamp", value: ``, inline: true } + ], + color: 0x00ff00 + }; - let files = []; - if (row.attachments) { - try { - const attachments = JSON.parse(row.attachments); - files = attachments.map(file => path.join(__dirname, '../../storage', file)); - } catch (e) { - files = []; - } - } + let files = []; + if (row.attachments) { + try { + const attachments = JSON.parse(row.attachments); + files = attachments.map(file => ({ + attachment: path.join(__dirname, '../../storage', file), + name: `SPOILER_${file}` + })) + } catch (e) { + files = []; + } + } - interaction.editReply({ embeds: [embed], files }); - } else { - interaction.editReply({ content: "That user is not listed as a bad actor.", ephemeral: true }); - } - }); + interaction.editReply({ embeds: [embed], files }); + } else { + interaction.editReply({ content: "That user is not listed as a bad actor.", ephemeral: true }); + } + }); } module.exports = { execute }; \ No newline at end of file