#How do you make a button for a link
1 messages · Page 1 of 1 (latest)
ButtonBuilder#setStyle()
Sets the style of this button
ButtonStyle.Link and then .setURL(…)
Thank you 10/10
How to define the variable ?
What variable?
ButtonStyle
Import from discord.js
I made a mistake
Show invite.js
yes
const Discord = require("discord.js")
module.exports = {
name: "invite",
description: "Inviter le bot dans vorte serveur !",
permission: "Aucune",
dm: true,
category: "Informations",
async run(bot, message, args) {
let Embed48 = new Discord.EmbedBuilder()
.setColor("#5288e0")
.setAuthor({name: `Ajoutez ---- à votre serveur !` , iconURL: `https://cdn.discordapp.com/attachments/1094728427979935835/1095669659509985331/FlutBot.png` , url: `https://discord.gg/----`})
ButtonStyle.Link
.setEmoji(":white_check_mark:")
.setURL("https://discord.gg/---")
await message.reply({embeds: [Embed48]})
}
}```
You don’t import ButtonStyle there… you can destructure it from Discord or simply use Discord.ButtonStyle
I didn't understand
What part?
You import the whole library and name it Discord. So all its exports are now properties of Discord. The same way you use the EmbedBuilder export you also need to use the ButtonStyle export
all
so let ButtonStyle1 = new Discord.ButtonStyle. () ?
'm lost in the code forest !
Can you give me an example of button code please?
You literally only have to prepend what you currently have with Discord.
So Discord.ButtonStyle.Link
And put that in a .setStyle(…)
Oh wait, that is an embed, not a button… why is there no button?
or with all the const.. or following the code
Just to double check, can you show me a screenshot of what you want to have? Maybe the button link got lost in translation
yes
Here
I want something likeI want something likent that
yes Thank you (I am a French I speak with Google Translate)
Interactions: Button styles