Custom emojis on buttons

how can i add custom emojis to my buttons?
17 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs3y ago
method ButtonBuilder#setEmoji() Sets the emoji to display on this button
MrMythical
MrMythical3y ago
djs version lets you pass an id that's builders version I linked
Ashura
AshuraOP3y ago
like this?
MrMythical
MrMythical3y ago
Try it and see
Ashura
AshuraOP3y ago
kk ValidationError > s.object(T) Expected the value to be an object, but received number instead Received: | 1045048019285966800 got this error
MrMythical
MrMythical3y ago
Show what you did And how you imported ButtonBuilder
Ashura
AshuraOP3y ago
cant shor the hole code ima divide it in 2
const { SlashCommandBuilder ,ActionRowBuilder, ButtonBuilder , EmbedBuilder , Events } = require('@discordjs/builders');
const { MessageEmbed , ButtonStyle} = require("discord.js")

const dinoname = 'dinoname';
module.exports = {
data: new SlashCommandBuilder()
.setName('create')
.setDescription('Cria uma ficha de Breed')
.addStringOption(option =>
option.setName('dinoname')
.setDescription('Dino que sera breedado')
.setRequired(true)),

async execute(interaction) {
const dinoname = interaction.options.getString("dinoname")
await interaction.reply(
criar = new EmbedBuilder()
.setColor(0xf20505)
.setTitle('\`${dinoname}\` Line')
.setDescription('Selecione os status breedados de \`${dinoname}\`'),
const { SlashCommandBuilder ,ActionRowBuilder, ButtonBuilder , EmbedBuilder , Events } = require('@discordjs/builders');
const { MessageEmbed , ButtonStyle} = require("discord.js")

const dinoname = 'dinoname';
module.exports = {
data: new SlashCommandBuilder()
.setName('create')
.setDescription('Cria uma ficha de Breed')
.addStringOption(option =>
option.setName('dinoname')
.setDescription('Dino que sera breedado')
.setRequired(true)),

async execute(interaction) {
const dinoname = interaction.options.getString("dinoname")
await interaction.reply(
criar = new EmbedBuilder()
.setColor(0xf20505)
.setTitle('\`${dinoname}\` Line')
.setDescription('Selecione os status breedados de \`${dinoname}\`'),
row = new ActionRowBuilder()
.addComponents(

new ButtonBuilder()
.setCustomId('health')
.setLabel('Health')
.setStyle (ButtonStyle.Secondary)
.setEmoji(1045048019285966848),

new ButtonBuilder()
.setCustomId('stamina')
.setLabel('Stamina')
.setStyle(ButtonStyle.Secondary)
.setEmoji(1045048216753819709),

new ButtonBuilder()
.setCustomId('melee')
.setLabel('Melee')
.setStyle(ButtonStyle.Secondary)
.setEmoji(1045048217982738553),

new ButtonBuilder()
.setCustomId('continue')
.setLabel('Continuar')
.setStyle(ButtonStyle.Success)
.setEmoji(1045430134192222220),

new ButtonBuilder()
.setCustomId('cancell')
.setLabel('Cancelar')
.setStyle(ButtonStyle.Danger)
.setEmoji(1045430320993931274)
),
channel.send({ embeds: [criar] })
)

}

}
row = new ActionRowBuilder()
.addComponents(

new ButtonBuilder()
.setCustomId('health')
.setLabel('Health')
.setStyle (ButtonStyle.Secondary)
.setEmoji(1045048019285966848),

new ButtonBuilder()
.setCustomId('stamina')
.setLabel('Stamina')
.setStyle(ButtonStyle.Secondary)
.setEmoji(1045048216753819709),

new ButtonBuilder()
.setCustomId('melee')
.setLabel('Melee')
.setStyle(ButtonStyle.Secondary)
.setEmoji(1045048217982738553),

new ButtonBuilder()
.setCustomId('continue')
.setLabel('Continuar')
.setStyle(ButtonStyle.Success)
.setEmoji(1045430134192222220),

new ButtonBuilder()
.setCustomId('cancell')
.setLabel('Cancelar')
.setStyle(ButtonStyle.Danger)
.setEmoji(1045430320993931274)
),
channel.send({ embeds: [criar] })
)

}

}
d.js docs
d.js docs3y ago
• Discord ids follow the snowflake format: learn more • Discord ids must be represented as strings as they are larger than Number.MAX_SAFE_INTEGER, the largest integer that can be represented in JavaScript
- client.guilds.cache.get(123456789012345678)
+ client.guilds.cache.get("123456789012345678")
- client.guilds.cache.get(123456789012345678)
+ client.guilds.cache.get("123456789012345678")
MrMythical
MrMythical3y ago
djs version lets you pass an id
import from djs, not builders
Ashura
AshuraOP3y ago
kk thx so , just one question , how do i use this command the bot just typed like v client.guilds.cache.get("123456789012345678")
MrMythical
MrMythical3y ago
wut?
Ashura
AshuraOP3y ago
how do i apply this client.guilds.chace.get in my code
MrMythical
MrMythical3y ago
why
Ashura
AshuraOP3y ago
dont i need it to ad my custom emojis?
MrMythical
MrMythical3y ago
no?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server