interaction is not defined

const { EmbedBuilder } = require('discord.js');


function errorMessage(message) {
    const reply = new EmbedBuilder()
        .setColor('Red')
        .setDescription(message);
    return interaction.reply({embeds: [reply]});
}

module.exports = errorMessage


I know this sound weird/retarded but hear me out, So I am creating a message.js (kinda) for my bot where I can use this function to reply with an embed without having to define it from every single file with something like this
errorMessage('I have an error')
Was this page helpful?