2022-06-17

How to Send Ephemeral Messages in Discord.js

Make a discord.js bot send ephemeral messages when a user uses a slash command, i have tried using interation.editReply({content: "etc-etc", ephemeral:true}); , and anything that seemed reasonable but it seemed unsuccessful, please send an example how i would implement ephemeral message!

Edit:

My Slash command Help file:

const { Message, Client } = require("discord.js");

module.exports = {
    name: "help",
    description: "Sends web page url for all commands",
    run: async (client, interaction) => {

        await interaction.deferReply({ephemeral: true});

        interaction.editReply({
            embeds: [
                {
                    title: `${client.user.username}'s Help Page`,
                    description: `https://help.tcb.jayeshrocks.xyz`,
                    color: "RANDOM"
                }
            ]
        })
    }
};

Now I am recieving interaction already replied errors



1 comment:

  1. Hey there I would like my question to be removed from this website, i am the original owner of the question and i can clearly see that you copied my question here from Stack Overflow, please remove it best regards, JayeshRocks!

    ReplyDelete