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

140
Views
Discord.js buttons package

I need little help. I want to set my buttons to be functional. I'm using this package discord-buttons
So, i created two buttons: for cleaning channel and locking channel.
I don't know how to set them to work.
There is code.

let opcijaKanala = new MessageButton()
.setStyle("green")
.setLabel("Otkljucaj kanal")
.setID("unlockChannel")

Maybe I need something like this?

client.on('buttonClicked' //... )
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The event for button clicks is interactionCreate

Something a little like this may work

client.on("interactionCreate", (ctx) => {
  if(!ctx.isButton()) return // filter out commands and non-buttons
  if(ctx.customId === "foobar") {
    // do something amazing
  }
})
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!