Answer the question
In order to leave comments, you need to log in
How to change one Embed to another Embed?
I want the bot to first send such an embed
And then change the previous one to this one
So far, I just got it like this, but it does not replace
command(bot, 'scan', (message) => {
const embed = new Discord.MessageEmbed()
.setTitle('Scaning:')
.setColor('#8B0000')
.setDescription('**0% [ ] end in 0.30s **')
message.channel.send(embed)
const membed = new Discord.MessageEmbed()
.setTitle('Scaning:')
.setColor('#8B0000')
.setDescription('**5% [=> ] end in 0.30s **')
message.channel.edit(membed)
})
});
Answer the question
In order to leave comments, you need to log in
you need to be able not only to write code, but also to understand what you write.
specifically about this line:
message.channel.edit(membed)
the .edit() method edits some channel data, for example: channel name, subject, permissions , etc.
moreover, in order to perform one of the above actions, you need to pass completely different parameters.
if you want to change the message sent by the bot, you must implement the following construct:
message.channel.send("сообщение").then(m => {
// ...где m является классом Message
m.edit("новый_контент_сообщения")
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question