#Potentially silly question for
1 messages · Page 1 of 1 (latest)
My code sits like this:
let row = new ActionRowBuilder();
for (let id in config.buttons) {
if (!Object.hasOwn(config.buttons,id)) { continue; }
let button = config.buttons[id];
row.addComponents(new ButtonBuilder()
.setCustomId('role_' + id)
.setLabel(button[2])
.setStyle(ButtonStyle[button[1]])
);
}
let chan = discordjs.client.channels.cache.get(config.channels.role_apply);
func.channel_send(chan,'',[],[],[row]).then();
If I limit the size of the array config.buttons to one, the button insert works fine, but it seems that I can't call row.addComponents() more than once, or I get the error Invalid Form Body
you need to use channel.send({ content: "...", components: [row] })