Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
discord-modals TypeError: Cannot read properties of undefined (reading 'EPHEMERAL')

I am using the package discord-modals to create better modals with my discord bot.

When I want to reply to the SlashCommandInteraction (actually it's the modalResponse listening event), then I can't make the reply ephemeral. When I remove the ephemeral bool, it works perfectly. But I don't understand why it doesn't work with a normal reply action.

await event.reply({content: `${replymsg}`, ephemeral: true});

So if I use this, I get the following error:

TypeError: Cannot read properties of undefined (reading 'EPHEMERAL')
    at ModalSubmitInteraction.reply (C:\Users\david_h7tqe3i\WebstormProjects\musicbottest\node_modules\discord-modals\src\v14\interfaces\InteractionResponses.js:51:57)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Client.<anonymous> (C:\Users\david_h7tqe3i\WebstormProjects\musicbottest\src\index.js:107:9)
Emitted 'error' event on Client instance at:
    at emitUnhandledRejectionOrErr (node:events:384:10)
    at processTicksAndRejections (node:internal/process/task_queues:85:21)

Process finished with exit code 1

And if I use the following code, it works:

await event.reply({content: `${replymsg}`});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There is a bug in discord-modals. It uses MessageFlags.FLAGS.EPHEMERAL, but MessageFlags.FLAGS is undefined. For a quick fix, you can edit node_modules/discord-modals/src/v14/interfaces/InteractionResponses.js and on line 51 replace

data.flags = options.ephemeral ? MessageFlags.FLAGS.EPHEMERAL : undefined;

with

data.flags = options.ephemeral ? MessageFlags.Ephemeral : undefined;

I've also opened a PR, hopefully, the maintainer will accept it soon.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!