discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.47k stars 3.97k forks source link

add some style to interaction button #10064

Closed Heavyrisem closed 11 months ago

Heavyrisem commented 11 months ago

Which application or package is this feature request for?

discord.js

Feature

in discord.js v13 I can send buttons with new line using MessageActionRow, MessageButton image

new MessageActionRow().addComponents(
                        new MessageButton()
                            .setStyle('PRIMARY')
                            .setLabel(`${i + 1}: ${V.title.slice(0, 50)} (${V.timestamp})`)
                            .setCustomId(JSON.stringify({ videoId: V.videoId, id: interaction.user.id })),
)

but discordjs v14 MessageActionRow, MessageButton are seems deprecated and buttons dosen't create new line between them image``

const buttons = [new ButtonBuilder()
        .setCustomId(String(index))
        .setLabel(
          `${title} - ${artists?.at(0)?.name} - ${formatSecondsToTime(
            duration?.totalSeconds ?? -1,
          )}`,
        )
        .setStyle(ButtonStyle.Primary)];
const row = new ActionRowBuilder<ButtonBuilder>().addComponents(buttons);

Ideal solution or implementation

image

Can discord.js v14 support this feature?

Alternative solutions or implementations

No response

Other context

No response

Idris1401 commented 11 months ago

you just need to put a button per row, and not all the buttons in the same row