How to get ID from embeded message Discordbot

I have a question. I was wondering if it was possible to get an ID from an embed message that a discord bot sent. I can get the ID of a normal message that a Discord bot has sent, but when I send an embed, I don’t get an ID from it. Does anyone know how I can solve this? I’ve tried many things, but I’m not getting any ID back from the last embed my Discord bot sent

Thanks in advance!

CODE:

 module.exports = 
{
  name: "reactionrole",
  description: "Sets up a reaction role message!",
  category: "info",
  usage: "Test <>",
  async execute(message, args, cmd, _client, Discord) 
  {
    const channel = '719992310988931143';
    const channel_by_ID = _client.channels.cache.get(channel);
    console.log("Chanel ID: " + channel_by_ID) // --> Geef Chanel ID
    console.log("Laatste message ID (USER): " + channel_by_ID.lastMessageID) // --> Message ID
    const yellowTeamRole = message.guild.roles.cache.find(role => role.name === "Davmin");
    const yellowTeamEmoji = `🌼`;
    global.globalvar;


    let test = new Discord.MessageEmbed()
      .setTitle("HOUSE RULES By connecting to this Discord server, you agree to the Holy Davino house rules.")
      .setColor("#ff2050")
      .setDescription("Choosing a team will allow you to interact with your teammates!nn"+ `${yellowTeamEmoji} for yellow teamn`)
      var bericht = await message.channel.send({embed: test}).then(embedMessage => {embedMessage.react(yellowTeamEmoji)});
      var testmessage = await message.channel.send("test")
     
    console.log("Test message: " + testmessage)
    // ID = bericht.id --> Not working
    console.log("Embed: " +  bericht)

    
        

    _client.on('messageReactionAdd', async(reaction, user, globalvar) => {

      console.log("React!")
      console.log("Global var (_Client.on): " + global.globalvar)
      console.log("Message ID (_Client.on): " + reaction.message.id)
      if(reaction.message.id == global.globalvar)
      {
        console.log("Wtf tot hier?");
        if(reaction.emoji.user === yellowTeamEmoji)
        {
          console("We zijn der ver!!!")
          reaction.message.guild.member(user).roles.add(yellowTeamRole);
        }
      }
      else 
      {
        console.log("Hij geraakt er niet")
      }
    });

  }
}

LOGS: Logs discord

Answer

var bericht = await message.channel.send({embed: test}).then(embedMessage => {embedMessage.react(yellowTeamEmoji)});

Here on the bericht variable, you’re sending a message then reacting to it, but you didn’t specify what it return. Therefore, embedMessage => embedMessage.react(yellowTeamEmoji)} returned undefined

If you want the bot to give you the message id back, you have to specify it.

var bericht = await message.channel.send({embed: test}).then(embedMessage =>{
  embedMessage.react(yellowTeamEmoji);
  return embedMessage.id;
});