'discord.js get message id from interaction message

I want to get message id from interaction message, but i can't get it :|

discord.js verson : ^13.1.0

client.on('interactionCreate',async interaction => {

    if(interaction.commandName==='test') {
        let message = await interaction.reply({content:'testing...',ephemeral:true});
        console.log(message); //undefined
    }

});


Solution 1:[1]

For latest version of Discord.js:

You can use the fetchReply property of InteractionReplyOptions to fetch the Message object after send it.

let message = await interaction.reply({content:'testing...',ephemeral:true, fetchReply: true});
console.log(message); //Message Object

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Akif9748