“Tombol Discord.js” Kode Jawaban

Tombol Discord.js

//Note that you need the Node module installed!
let button = new disbut.MessageButton()
  .setStyle('red') //default: blurple
  .setLabel('My First Button!') //default: NO_LABEL_PROVIDED
  .setID('click_to_function') //note: if you use the style "url" you must provide url using .setURL('https://example.com')
  .setDisabled(); //disables the button | default: false

message.channel.send('Hey, i am powered by https://npmjs.com/discord-buttons', button);
Arjinoodles

Tombol Discord.js

client.on('message', message => {
if(message.content.startsWith(prefix + "ticket-message")) {
    let btn1 = new disbut.MessageButton()
    .setStyle('red')
    .setEmoji(":ticket:")
    .setID('1')
    message.delete()
    message.channel.send(`react here to open a ticket`, btn1)
    }
})
client.on('clickButton', async (button) => {
    await button.defer();
    if(button.id === "1") {
    let btn2 = new disbut.MessageButton()
    .setLabel('close')
    .setStyle('red')
    .setEmoji(":x:")
    .setID('2')
  button.guild.channels.create(`${button.clicker.user.username} ticket`, {
    permissionOverwrites: [
        {
            id: button.guild.roles.everyone,
            deny: ['VIEW_CHANNEL'],
        },
        {
            id: button.clicker.user.id,
            allow: ['VIEW_CHANNEL'],
        },
    ],
}).then(channel => {
      channel.send(`**please wait for our support team \n react with the emoji to close the ticket**`, btn2)

  })

    }
        if(button.id === "2") {
    
     button.channel.send("deleting after 5 seconds")
     setTimeout(function() {
     button.channel.delete();
    }, 5000)
    }
})
EXATUBE™

Tombol Perselisihan Discord.js

npm i discord-buttons
Mysterious Mosquito

Jawaban yang mirip dengan “Tombol Discord.js”

Pertanyaan yang mirip dengan “Tombol Discord.js”

Lebih banyak jawaban terkait untuk “Tombol Discord.js” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya