Message Object sending ephemeral message

In Typescript, I am trying to use Message Object to send ephemeral message but it seems like that is not possible Is there a way that I can make the messagecreate function able to execute with the Message object in sending ephemeral messages
export default new Event({
name: Events.MessageCreate,
async execute(message: Message): Promise<void> {
// Not working
await message.channel.send({
content: `👤 <@${message.author.id}>\n`,
ephemeral: true,
});
}
});
export default new Event({
name: Events.MessageCreate,
async execute(message: Message): Promise<void> {
// Not working
await message.channel.send({
content: `👤 <@${message.author.id}>\n`,
ephemeral: true,
});
}
});
5 Replies
d.js toolkit
d.js toolkit•2d ago
- 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!
Vandyck
VandyckOP•2d ago
is it possible to pass the execute with type Interaction instead? I cant seem to make tis work or is there any other workaround like from accesing through the global client? trying to send ephemeral messages through messageCreate function basically there are use case where user wont tag bot or wont trigger commands, just type some messages where the bot should respond with ephemeral I see, alright. Guess I need to think of a workaround
Syjalo
Syjalo•2d ago
There's modal, if you need an input from the user
d.js docs
d.js docs•2d ago
:guide: Other Interactions: Modals read more
Vandyck
VandyckOP•2d ago
Yea, were using that But figured with the team wanted to standardize the flow with tg and whatsapp

Did you find this page helpful?