What is the MessageActionRow with djs v14?
I have and I'm getting this error:
I'm assuming it is because djs v14 changed something?
const { MessageActionRow, MessageButton } = require('discord.js');
and
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setLabel('Erin\'s Support Server')
.setStyle('LINK')
.setURL('https://discord.gg/tT3VEW8AYF'),
new MessageButton()
.setLabel('Fill out this form!')
.setStyle('LINK')
.setURL('https://codinghelp.site')
)
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setLabel('Erin\'s Support Server')
.setStyle('LINK')
.setURL('https://discord.gg/tT3VEW8AYF'),
new MessageButton()
.setLabel('Fill out this form!')
.setStyle('LINK')
.setURL('https://codinghelp.site')
)
TypeError: MessageActionRow is not a constructor
at Object.execute (/root/taco-cat-bot/events/messageCreate.js:66:25)
at Client.<anonymous> (/root/taco-cat-bot/index.js:108:49)
at Client.emit (node:events:527:28)
at MessageCreateAction.handle (/root/taco-cat-bot/node_modules/discord.js/src/client/actions/MessageCreate.js:23:14)
at Object.module.exports [as MESSAGE_CREATE] (/root/taco-cat-bot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/root/taco-cat-bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:352:31)
at WebSocketShard.onPacket (/root/taco-cat-bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:481:22)
at WebSocketShard.onMessage (/root/taco-cat-bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:321:10)
at WebSocket.onMessage (/root/taco-cat-bot/node_modules/ws/lib/event-target.js:199:18)
at WebSocket.emit (node:events:527:28)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:384:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21)
TypeError: MessageActionRow is not a constructor
at Object.execute (/root/taco-cat-bot/events/messageCreate.js:66:25)
at Client.<anonymous> (/root/taco-cat-bot/index.js:108:49)
at Client.emit (node:events:527:28)
at MessageCreateAction.handle (/root/taco-cat-bot/node_modules/discord.js/src/client/actions/MessageCreate.js:23:14)
at Object.module.exports [as MESSAGE_CREATE] (/root/taco-cat-bot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/root/taco-cat-bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:352:31)
at WebSocketShard.onPacket (/root/taco-cat-bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:481:22)
at WebSocketShard.onMessage (/root/taco-cat-bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:321:10)
at WebSocket.onMessage (/root/taco-cat-bot/node_modules/ws/lib/event-target.js:199:18)
at WebSocket.emit (node:events:527:28)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:384:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21)
4 Replies
it's now ActionRowBuilder
MessageButton is ButtonBuilder
Read the changelog
Ty!
What about the button styles? https://discordjs.guide/interactions/buttons.html#button-styles
I read the changelog and I didn't see anything but I'm getting an error:
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:384:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21) {
value: 'LINK',
enumKeys: [ 'Primary', 'Secondary', 'Success', 'Danger', 'Link' ],
enumMappings: Map(15) {
'Primary' => 1,
1 => 1,
'1' => 1,
'Secondary' => 2,
2 => 2,
'2' => 2,
'Success' => 3,
3 => 3,
'3' => 3,
'Danger' => 4,
4 => 4,
'4' => 4,
'Link' => 5,
5 => 5,
'5' => 5
}
}
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:384:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21) {
value: 'LINK',
enumKeys: [ 'Primary', 'Secondary', 'Success', 'Danger', 'Link' ],
enumMappings: Map(15) {
'Primary' => 1,
1 => 1,
'1' => 1,
'Secondary' => 2,
2 => 2,
'2' => 2,
'Success' => 3,
3 => 3,
'3' => 3,
'Danger' => 4,
4 => 4,
'4' => 4,
'Link' => 5,
5 => 5,
'5' => 5
}
}
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Is it because I have it caps?
It was.