on message edit discord js code example
Example 1: discord.js edit message by id
client.channels.cache.get(channelid).fetchMessage(messageid).then(msg => msg.delete());
Example 2: how to edit message discord.js
message.channel.send("Beep").then((sentMessage) => sentMessage.edit("Boop!"