Skip to content

Problems with ephemeral messages from discord.js v14.14.1 and forwards. #564

Description

@Mr-Dobby
  • Apologies in advance, I should've made a PR, but I'm kinda new to github please forgive <3

Describe the bug
When calling ephemeral: true, in slash commands, you will receive a warning like this:
(node:957320) Warning: Supplying "ephemeral" for interaction response options is deprecated. Utilize flags instead.
This is after updating to at least @14.14.1
I have tested this with all versions up to v14.18.1, and get the same warnings throughout

To Reproduce
Run anything where ephemeral is set to true

Expected behavior
It does what it is supposed to. I only realised it after problems with interaction setup in /unban.
Having fixed that, this warning came across after updating discord.js
For now it's just a warning, but presumably this will give stop errors in the future.

Screenshots

Image

If possible

  • NodeJS version: v20.17.0
  • Bot version: Latest

Additional context
I think I found a stable fix.
By tracing errors I was able to conclude this line in file (src/handlers/command.js) 138:
await interaction.deferReply({ ephemeral: cmd.slashCommand.ephemeral });

By simply updating it to this, I no longer get these warnings.
await interaction.deferReply({ flags: cmd.slashCommand.ephemeral ? 64 : undefined, });
Flag 64 is the new ephemeral flag, as they no longer run with true/false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions