const { SlashCommandBuilder } = require("@discordjs/builders"); const { MessageActionRow, MessageButton, MessageEmbed, Message, } = require("discord.js"); module.exports = { data: new SlashCommandBuilder() .setName("colorize") .setDescription("Turn any black & white image into a colored one!"), async execute(interaction) { const filter = (m) => m.attachments.size > 0; await interaction.editReply({ content: "Kindly send a black and white image in this channel within 15 seconds.", }); const collector = interaction.channel.createMessageCollector({ filter, time: 15000, }); collector.on("collect", async (m) => { console.log("It works?"); const attachment_url = [...m.attachments.values()][0].url; if (!attachment_url) { return await interaction.followUp({ content: "Please send a valid black and white image", fetchReply: true, }); } const resp = // smtb console.log(resp); const embed = new MessageEmbed() .setTitle("Colored Image") .setImage(resp["output"]) .setColor(color) .setAuthor({ name: interaction.user.username, iconURL: interaction.user.avatarURL(), }) .setFooter({ text: `Generated by ${interaction.user.username}` }); await interaction.followUp({ embeds: [embed] }); }); collector.on("end", (collected) => { console.log(`Collected ${collected.size} items`); }); }, };