Compare commits
No commits in common. "99d996818b80582cc9ec7c77091dceec7364ac99" and "911b3aac8e99f015fd44017db6713e10c7efb595" have entirely different histories.
99d996818b
...
911b3aac8e
|
|
@ -71,7 +71,7 @@ module.exports = (member, db, client) => {
|
||||||
}],
|
}],
|
||||||
files: row.attachments ? JSON.parse(row.attachments).map(file => ({
|
files: row.attachments ? JSON.parse(row.attachments).map(file => ({
|
||||||
attachment: path.join(__dirname, '../storage', file),
|
attachment: path.join(__dirname, '../storage', file),
|
||||||
name: `SPOILER_${file}`
|
name: file
|
||||||
})) : []
|
})) : []
|
||||||
}).catch(console.error);
|
}).catch(console.error);
|
||||||
}).catch(console.error);
|
}).catch(console.error);
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ const execute = async (interaction, db, client) => {
|
||||||
content: `User <@${user}> has been added to the bad actors list by <@${interaction.user.id}>.`,
|
content: `User <@${user}> has been added to the bad actors list by <@${interaction.user.id}>.`,
|
||||||
files: attachments.map(file => ({
|
files: attachments.map(file => ({
|
||||||
attachment: path.join(__dirname, '../../storage', file),
|
attachment: path.join(__dirname, '../../storage', file),
|
||||||
name: `SPOILER_${file}`
|
name: file
|
||||||
}))
|
}))
|
||||||
}).then(msg => {
|
}).then(msg => {
|
||||||
if (msg.channel.type == Discord.ChannelType.GuildAnnouncement) {
|
if (msg.channel.type == Discord.ChannelType.GuildAnnouncement) {
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,36 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
const execute = async (interaction, db, client) => {
|
const execute = async (interaction, db, client) => {
|
||||||
if (!interaction.isCommand()) return;
|
if (!interaction.isCommand()) return;
|
||||||
await interaction.deferReply({ ephemeral: true }).catch(console.error);
|
await interaction.deferReply({ ephemeral: true }).catch(console.error);
|
||||||
interaction.options.getUser("user").id
|
interaction.options.getUser("user").id
|
||||||
db.get("SELECT * FROM badActors WHERE id = ?", [interaction.options.getUser("user").id], async (err, row) => {
|
db.get("SELECT * FROM badActors WHERE id = ?", [interaction.options.getUser("user").id], async (err, row) => {
|
||||||
if (row) {
|
if (row) {
|
||||||
const embed = {
|
const embed = {
|
||||||
title: "Bad Actor Found",
|
title: "Bad Actor Found",
|
||||||
description: `User <@${row.id}> is in the bad actors list.`,
|
description: `User <@${row.id}> is in the bad actors list.`,
|
||||||
fields: [
|
fields: [
|
||||||
{ name: "Reported By", value: `<@${row.reportedBy}>`, inline: true },
|
{ name: "Reported By", value: `<@${row.reportedBy}>`, inline: true },
|
||||||
{ name: "Comment", value: row.comment || "No comment provided", inline: false },
|
{ name: "Comment", value: row.comment || "No comment provided", inline: false },
|
||||||
{ name: "Timestamp", value: `<t:${Math.floor(new Date(row.timestamp) / 1000)}>`, inline: true }
|
{ name: "Timestamp", value: `<t:${Math.floor(new Date(row.timestamp)/1000)}>`, inline: true }
|
||||||
],
|
],
|
||||||
color: 0x00ff00
|
color: 0x00ff00
|
||||||
};
|
};
|
||||||
|
|
||||||
let files = [];
|
let files = [];
|
||||||
if (row.attachments) {
|
if (row.attachments) {
|
||||||
try {
|
try {
|
||||||
const attachments = JSON.parse(row.attachments);
|
const attachments = JSON.parse(row.attachments);
|
||||||
files = attachments.map(file => ({
|
files = attachments.map(file => path.join(__dirname, '../../storage', file));
|
||||||
attachment: path.join(__dirname, '../../storage', file),
|
} catch (e) {
|
||||||
name: `SPOILER_${file}`
|
files = [];
|
||||||
}))
|
}
|
||||||
} catch (e) {
|
}
|
||||||
files = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.editReply({ embeds: [embed], files });
|
interaction.editReply({ embeds: [embed], files });
|
||||||
} else {
|
} else {
|
||||||
interaction.editReply({ content: "That user is not listed as a bad actor.", ephemeral: true });
|
interaction.editReply({ content: "That user is not listed as a bad actor.", ephemeral: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
module.exports = { execute };
|
module.exports = { execute };
|
||||||
Loading…
Reference in a new issue