ReferenceError: interaction is not defined

I need help defining ‘interaction’ I do not know how to fix this but here is my code. I’m trying to get the slash command’s author to get their user tag and avatar and put it in the author of the embed. Could anyone help me out?

The problem I am facing is with the .setAuthor field in which 'interaction' is undefined.

Here is the .setAuthor code:

.setAuthor({ name: interaction.user.tag, url: interaction.user.displayAvatarURL(), iconURL: interaction.user.displayAvatarURL() })

Here is my full code:

const Discord = require('discord.js');
const { Client, Intents } = require('discord.js');
const { token } = require('./config.json');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
const { MessageEmbed } = require('discord.js')

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

const embed = new Discord.MessageEmbed()
    .setColor('#0099ff')
    .setTitle('Hello!')
    .setURL('https://discord.js.org/')
    .setAuthor({ name: interaction.user.tag, url: interaction.user.displayAvatarURL(), iconURL: interaction.user.displayAvatarURL() })
    .setDescription('Hello! This is a test embed')
    .setThumbnail('https://i.imgur.com/AfFp7pu.png')
    .setTimestamp()
    .setFooter({ text: 'Some footer text here', iconURL: 'https://i.imgur.com/AfFp7pu.png' });


client.on('interactionCreate', async interaction => {
    if (!interaction.isCommand()) return;

    const { commandName } = interaction;

    if (commandName === 'ping') {
        await interaction.reply(`Pong! My current response time is: **`${client.ws.ping}`** ms`);
    } else if (commandName === 'server') {
        await interaction.reply(`Server name: ${interaction.guild.name}nTotal members: ${interaction.guild.memberCount}nServer Creation Date: ${interaction.guild.createdAt}nServer Verification Level: ${interaction.guild.verificationLevel}`);
    } else if (commandName === 'user') {
        await interaction.reply(`**User info for ${interaction.user.username}**nUser Tag: ${interaction.user.tag}nUser ID: ${interaction.user.id}`);
    } else if (commandName === 'embed') {
    await interaction.reply({ embeds:  });
  }
});

client.login(token);

If anyone knows how to fix this please let me know. Thanks!