Answer the question
In order to leave comments, you need to log in
Why are discord.js buttons not working?
The button doesn't work and I don't understand why.
const { MessageEmbed } = require('discord.js');
const discord = require('discord.js'); //Define the discord.js module
const client = new discord.Client(); //Creating discord.js client (constructor)
const disbut = require('discord-buttons');
disbut(client);
module.exports.properities = {
name:["321"]
}
module.exports.run = async (bot,message,member,args) => {
if(!message.author.id == (292353154111242241))return
const btn1 = new disbut.MessageButton()
.setStyle('red')
.setID(`click`)
.setLabel('asdasdasdasd')
// .setURL('https://npmjs.com/discord-buttons')
.setDisabled(false);
message.channel.send(`RowsTest`, { component: btn1 });
btn1.on('clickButton', async (button) => {
if (button.id == "click_to_function") {
button.reply.send('On Red Button click', { ephemeral: true });
}
})
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question