Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

128
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda