Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

147
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda