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.", }) .then(() => { interaction.channel .awaitMessages({filter, max: 1, time: 15000 }) .then(async (collected) => { console.log("It works?") const m = collected.first() 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 = // smth 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] }); }) .catch((collected) => { console.log(collected) interaction.followUp( "Looks like you did not send the image in time." ); }) .catch(err => { console.log(err) }); }); }, };