const { SlashCommandBuilder } = require('discord.js'); module.exports = { data: new SlashCommandBuilder() .setName('qualitycontrol') .setDescription('Submit an image for quality control') .addStringOption(option => option.setName('image') .setDescription('The image to be checked') .setRequired(true)), async execute(interaction) { const image = interaction.options.getString('image'); // Send the image in a forum with a quality control check message const forumChannel = interaction.guild.channels.cache.get('forum-channel-id'); const qualityControlMessage = await forumChannel.send({ content: 'Quality Control Check', files: [image] }); // Ping quality control members to check the image const qualityControlRole = interaction.guild.roles.cache.get('quality-control-role-id'); forumChannel.send(`${qualityControlRole}, please check the image.`); // Add accept and deny buttons to the quality control message await qualityControlMessage.react('✅'); // Accept button await qualityControlMessage.react('❌'); // Deny button // Wait for a reaction from quality control members const filter = (reaction, user) => ['✅', '❌'].includes(reaction.emoji.name) && qualityControlRole.members.has(user.id); const collector = qualityControlMessage.createReactionCollector({ filter, time: 60000 }); collector.on('collect', async (reaction, user) => { if (reaction.emoji.name === '✅') { // Accepted const userDM = await user.createDM(); userDM.send('Your image has been accepted.'); } else if (reaction.emoji.name === '❌') { // Denied const userDM = await user.createDM(); userDM.send('Your image has been denied.'); } }); // Handle collector end event collector.on('end', collected => { // Do something when the collector ends (e.g., remove buttons, send a notification) }); await interaction.reply('Your image has been submitted for quality control.'); }, };