I want to make One embed turn into The second embed when someone reacts with the thumbs up, but ever attempt at this has failedβ¦
const Discord = require("discord.js");
module.exports = {
name: "start",
description: "this is a shop command!",
execute(message, args) {
const embed = new Discord.MessageEmbed()
.setTitle("The Diner | Start")
.setColor("#12e080")
.setThumbnail(
"https://cdn.glitch.com/494de277-06ea-4e76-95eb-1d9d87a0e5a4%2Funknown%20(2).png?v=1598630444256"
)
.addFields({
name: `${message.author.username}, **ARE YOU SURE?**`,
value: `${message.author.username}, You can only use this command once, and once you use it you will start your own restaurant that **you and you alone will have to manage!**`,
inline: true
})
.setFooter("Start your restaurant today!");
message.channel.send(embed).then(sentEmbed => {
sentEmbed.react("π");
sentEmbed.react("π");
const filter = (reaction, user) => {
return (
["π", "π"].includes(reaction.emoji.name) &&
user.id === message.author.id
);
};
sentEmbed
.awaitReactions(filter, { max: 1, time: 30000, errors: ["time"] })
.then(collected => {
const reaction = collected.first();
if (reaction.emoji.name === "π") {
const embed2 = new Discord.MessageEmbed()
//embed stuff
message.edit(embed2).then(sentEmbed => {
sentEmbed.react("π");
sentEmbed.react("π₯―");
sentEmbed.react("π¨");
sentEmbed.react("π§");
sentEmbed.react("π₯");
sentEmbed.react("π");
sentEmbed.react("π");
sentEmbed.react("π₯©");
sentEmbed.react("π");
sentEmbed.react("π");
const filter = (reaction, user) => {
return (
[
"π",
"π₯―",
"π¨",
"π§",
"π₯",
"π",
"π",
"π₯©",
"π",
"π"
].includes(reaction.emoji.name) &&
user.id === message.author.id
);
};
sentEmbed
.awaitReactions(filter, {
max: 1,
time: 60000,
errors: ["time"]
})
.then(collected => {
const reaction = collected.first();
if (reaction.emoji.name === "π") {
message.channel.send(
`"${message.author.username}", You have selected the Italian Restaurant!`
);
}
if (reaction.emoji.name === "π¨") {
message.channel.send(
`"${message.author.username}", You have selected the Ice Cream Truck!`
);
}
if (reaction.emoji.name === "π§") {
message.channel.send(
`"${message.author.username}", You have selected the Waffle House!`
);
}
if (reaction.emoji.name === "π₯") {
message.channel.send(
`"${message.author.username}", You have selected the Pancake Place!`
);
}
if (reaction.emoji.name === "π₯―") {
message.channel.send(
`"${message.author.username}", You have selected the Donut Shop!`
);
}
if (reaction.emoji.name === "π") {
message.channel.send(
`"${message.author.username}", You have selected the Lemonade Stand!`
);
}
if (reaction.emoji.name === "π") {
message.channel.send(
`"${message.author.username}", You have selected the Asian Grill!`
);
}
if (reaction.emoji.name === "π₯©") {
message.channel.send(
`"${message.author.username}", You have selected the Steak House!`
);
}
if (reaction.emoji.name === "π") {
message.channel.send(
`"${message.author.username}", You have selected the Pizzaria!`
);
}
if (reaction.emoji.name === "π") {
message.channel.send(
`"${message.author.username}", You have selected the Burger Place!`
);
}
})
.catch(collected => {
message.reply(
`Are you listening? You didn't answer the question!`
);
});
});
}
})
.catch(collected => {
message.reply(`Are you listening? You didn't answer the question!`);
});
});
}
};
Any idea how to fix this?