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) { await interaction .editReply({ content: "Kindly send a black and white image in this channel within 15 seconds.", }) .then(() => { interaction.channel .awaitMessages({ max: 1, time: 15000 }) .then(async (collected) => { const m = collected.first(); console.log(m) const attachment_url = [...m.attachments.values()][0].url; if (!attachment_url) { return await interaction.followUp({ content: "Please send a valid black and white image", }); } const resp = // Something Something 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) }); }); }, };