How to add "ephemeral message" code to my code
i have commands that i need to add this to, and dont know how to do it.
49 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPNode: v22.14.0
set it in the message flags in an interaction reply
:propertysignature: InteractionReplyOptions#flags
[email protected]
Which flags to set for the message. Only MessageFlags.Ephemeral, MessageFlags.SuppressEmbeds, and MessageFlags.SuppressNotifications can be set.
The ephemeral
option when replying to an interaction will be removed in v15
Read here on how to specify multiple flagsYes
Okay
needs content key
{ content: '...', flags: ... }
Okayz
So like this?
await interaction.reply({content:'Skulls Socials', flags: MessageFlags.Ephemeral});
How do you highlight code?
It gave an error
Codeblocks:
```js
const Discord = require("discord.js");
// further code
```
becomes
Inline Code:
`console.log('inline!');` becomes
console.log('inline!');
Ok
Still have an error
Codeblocks:
```js
const Discord = require("discord.js");
// further code
```
becomes
Inline Code:
`console.log('inline!');` becomes
console.log('inline!');
Oh ok-
Add in the back ticks as shown to get the formatting
console.log(‘test’)
Ooh
I got an error when i ran this.What's the error?
Ooh
One sec
Did you not import MessageFlags?
Hm?
This the error-

You need to import MessageFlags. It's an enum for numbers
This what i have-

You still need to import MessageFlags. You're only importing SlashCommandBuilder
Okay. So i add MessageFlags?
Done, now what?
Then you're done. That error is fixed
Unless something else is wrong (which nothing is here) then it should work
It works.
But theres little dots under it-
How do i remove those?
What do you mean dots?
These

A. It's a bug with Discord...try restarting your app or trying on desktop/web
B. There's something happening before you send your interaction to your command file...can you send your file that contains your
client.on('interactionCreate')
?
C. IdkIll do b in a sec. Lemme find the file.
Index?
I don't know what it is for you. It could be in your index.js unless you moved it out into events/interactionCreate.js or something similar
Okay.
Lemme send the file. One sec.
Gotta open the app- very slow on pc-
Heres the file.
Does it work?
Going to bed
Awake
Can yall help?
make sure this is your actual code in your command
the screenshot suggests you haven't saved yet nvm doesn't look like it says that, still double check
It is
sounds like a client issue then
does it show the same thing in your pc client?
I dont know im not home right now.
Ill lyk when i get home.
No. It doesnt do it on pc.
Just mobile.
client issue then
make sure it's updated
Whats updated?
your client
aka your discord app
Oh okatz
Lemme look
Its updated :)
are you running stable or canary?
Hm?
How do i find that out?
if you didn't register for canary then you aren't
no idea then, but it's no longer a djs issue
Okay.
Who do i ask then?
You can mark it as done.