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

145
Views
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 answers
Answer question

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 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!