0
votes

So I would like to know if it is possible to edit a message Embed with the user's reply. I will post the code below and the example.

module.exports.run = async (Client, message, args) => {
    let battleChannel = message.channel;
    const filter = (m) => !m.content.length === 3;
    message.reply("Please enter your alliance name... Will expire in 10 seconds...");
    message.channel
        .awaitMessages(filter, { max: 1, time: 10000 })
        .then((collected) => {
            let game = new Listing();

            let editLast3 = null;

            let startMessage = new Discord.MessageEmbed().setTitle("1657 Battles").setDescription("Please write your alliance.").setColor("#0099ff").setTimestamp().setFooter(`Maintained by UKzs`);
            message.delete();
            message.channel.send(new Discord.MessageEmbed().setTitle("1657 Battles").setDescription("").setColor("#0099ff").setTimestamp().setFooter(`Maintained by UKzs`));
        })
        .catch((err) => {
            console.log(err);
        });
};

So as you can see I have the first part then I am waiting for a response from the user so I would type the following command !start = The bot will them bot the above info and wait for me to reply = I then reply with 57kl = Is there a way to then update the embed with 57kl instead of "Please write your alliance."

Thank you Ukzs

1
someMessageSentByTheBot.edit(newContentHere) is probably what you want - cursorsdottsx

1 Answers

0
votes

You can store the embed/message you send initially:

const original = await message.channel.send(embed);

then edit it after you collected the message:

original.edit(newEmbed);