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

144
Vistas
Discord Modals without TextInputComponent but a Text and Button only

I just discovered discord-modals, and I've tried using it when asking for information with the TextInputComponent.

After a while, I became curious about achieving this: The message that pops up when deleting a channel.

The image above is the pop-up message (a modal) that appears when you try to delete a channel. It has a title, a description, and two clickable buttons: "Cancel" and "Delete Channel". This is what I'm trying to achieve using discord-modals.

I'm creating a lottery bot that has its own economy. There's an embedded message and a button in a certain channel:

Embedded Message and Button

And what I had in mind was after clicking the button, it will show a modal then say "Are you sure you want to pay 50 Euros?" with a clickable button "Confirm" (just like the Delete Channel format).

This might be too ambitious. And yes, I've read the documentation of discord-modals that it only accepts TextInputComponent, but I reckoned that I'll post a question here since it's an interesting discussion whether or not it's possible in the first place (or how can I work around it). Is this possible to code?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Well a better way is to send a message with 2 buttons with the same style as the buttons when deleting a channel:

const row = new Discord.MessageActionRow()
.setComponents(
  new Dicord.MessageButton()
    .setLabel('Cancel')
    .setStyle('SECONDARY')
    .setCustomId('cancel'),
    .setLabel('Confirm')
    .setStyle('DANGER')
    .setCustomId('confirm'),
)
const confirmMsg = await interaction.followUp({
  content : "Are you sure you want to do this?",
  components : [row],
  fetchReply : true
})

then listen to it's components with confirmMsg.createMessageComponentCollectorso that if the message is confirmed or cancelled, you do what you're supposed to do.

With discord-modals you can only ask for text input and not for button interactions like the image

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