My Discord Buttons function cannot identify the command i want it to identify #64
-
I followed the discord.js v13 guide on discord buttons and i dont think it can identify the file in order to execute the button function. Index.js code sample
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
Send stack trace and your code? |
Beta Was this translation helpful? Give feedback.
-
This interesting may I know why there are buttons in a ping command? |
Beta Was this translation helpful? Give feedback.
-
@S4ge-Rites try create this in new file const { MessageButton, MessageActionRow } = require("discord.js");
module.exports = {
name: 'test1',
description: 'random message',
execute(message, args)
{
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setLabel("uwu")
.setCustomId('primary')
.setLabel('Primary')
.setStyle('PRIMARY')
.setDisabled(true)
);
message.reply({ content: 'Pong!', components: [row] });
},
}; |
Beta Was this translation helpful? Give feedback.
@S4ge-Rites try create this in new file
u cant just copy and paste example file from discord.js guide our code doesnt work like the guide one, we read message and args seperately
try read this code and understand: