“diskord.js button” Code-Antworten

diskord.js button

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

diskord.js button

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™

Discord Buttons Discord.js

npm i discord-buttons
Mysterious Mosquito

Ähnliche Antworten wie “diskord.js button”

Fragen ähnlich wie “diskord.js button”

Weitere verwandte Antworten zu “diskord.js button” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen