I cant put emojis in buttons.

const appealEmbed = new EmbedBuilder() .setTitle("Appeal A Moderator Action") .setDescription("If you received a warning, mute, or ban and wish to appeal, use the buttons below based on your punishment.") .addFields( { name: "โš ๏ธ Warn Appeals", value: "Appeal if you received a warning." }, { name: "๐Ÿ”‡ Mute Appeals", value: "Appeal if you were muted." }, { name: "โŒ Ban Appeals", value: "Appeal if you were banned." } ); const warnButton = new ButtonBuilder() .setCustomId("warnappeal") .setLabel("Warn Appeals") .setStyle(ButtonStyle.Secondary) const muteButton = new ButtonBuilder() .setCustomId("muteappeal") .setLabel("Mute Appeals") .setStyle(ButtonStyle.Secondary) const banButton = new ButtonBuilder() .setCustomId("banappeal") .setLabel("Ban Appeals") .setStyle(ButtonStyle.Secondary) const row = new ActionRowBuilder() .addComponents(warnButton, muteButton, banButton); Will not work with the following error:
43 Replies
lor3512
lor3512OPโ€ข8mo ago
ValidationError: Expected the value to be an object, but received string instead at _ObjectValidator.handle (/Users/leo/Documents/DiscordBots/AussieArmyAssistant/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:1958:25) at _ObjectValidator.parse (/Users/leo/Documents/DiscordBots/AussieArmyAssistant/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:939:90) at ButtonBuilder.setEmoji (/Users/leo/Documents/DiscordBots/AussieArmyAssistant/node_modules/@discordjs/builders/dist/index.js:668:38) at callback (/Users/leo/Documents/DiscordBots/AussieArmyAssistant/commands/appealembed.js:34:8) at CommandHandler.runCommand (/Users/leo/Documents/DiscordBots/AussieArmyAssistant/node_modules/wokcommands/dist/command-handler/CommandHandler.js:168:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async exports.default (/Users/leo/Documents/DiscordBots/AussieArmyAssistant/node_modules/wokcommands/dist/event-handler/events/interactionCreate/isCommand/slash-commands.js:23:22) { validator: 's.object(T)', given: '๐Ÿ”‡' } Node.js v20.10.0 [nodemon] app crashed - waiting for file changes before starting...
d.js toolkit
d.js toolkitโ€ข8mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - โœ… Marked as resolved by OP
lor3512
lor3512OPโ€ข8mo ago
[email protected] v20.10.0 Also if possible, idk if you can do custom emojis in it.
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
Ah k let me see ValidationError: Expected the value to be an object, but received string instead at _ObjectValidator.handle (/Users/leo/Documents/DiscordBots/AussieArmyAssistant/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:1958:25) at _ObjectValidator.parse (/Users/leo/Documents/DiscordBots/AussieArmyAssistant/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:939:90) at ButtonBuilder.setEmoji (/Users/leo/Documents/DiscordBots/AussieArmyAssistant/node_modules/@discordjs/builders/dist/index.js:668:38) at callback (/Users/leo/Documents/DiscordBots/AussieArmyAssistant/commands/appealembed.js:34:8) at CommandHandler.runCommand (/Users/leo/Documents/DiscordBots/AussieArmyAssistant/node_modules/wokcommands/dist/command-handler/CommandHandler.js:168:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async exports.default (/Users/leo/Documents/DiscordBots/AussieArmyAssistant/node_modules/wokcommands/dist/event-handler/events/interactionCreate/isCommand/slash-commands.js:23:22) { validator: 's.object(T)', given: '๐Ÿ”‡' } const muteButton = new ButtonBuilder() .setCustomId("muteappeal") .setLabel("Mute Appeals") .setStyle(ButtonStyle.Secondary) .setEmoji('๐Ÿ”‡') @Jรด ๐ŸŒˆ๐Ÿฆ„
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
How?
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
Kinda
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
AHHHHH const { CommandType } = require("wokcommands"); const { EmbedBuilder, ButtonStyle } = require("discord.js"); const { ButtonBuilder, ActionRowBuilder } = require("@discordjs/builders");
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docsโ€ข8mo ago
discord.js includes multiple sub-packages, installing these separately can mess with internal code:
npm uninstall discord-api-types @discordjs/rest @discordjs/builders
yarn remove discord-api-types @discordjs/rest @discordjs/builders
pnpm remove discord-api-types @discordjs/rest @discordjs/builders
npm uninstall discord-api-types @discordjs/rest @discordjs/builders
yarn remove discord-api-types @discordjs/rest @discordjs/builders
pnpm remove discord-api-types @discordjs/rest @discordjs/builders
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
K
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
Now it dosent send the buttons
const { CommandType } = require("wokcommands");
const { EmbedBuilder, ButtonStyle, ButtonBuilder, ActionRowBuilder } = require("discord.js");

module.exports = {
// Required for slash commands
description: "Send the appeal embed.",

// Create a legacy and slash command
type: CommandType.BOTH,

// Invoked when a user runs the ping command
callback: () => {
const { MessageActionRow, MessageButton, MessageEmbed } = require('discord.js');

const appealEmbed = new EmbedBuilder()
.setTitle("Appeal A Moderator Action")
.setDescription("If you received a warning, mute, or ban and wish to appeal, use the buttons below based on your punishment.")
.addFields(
{ name: "โš ๏ธ Warn Appeals", value: "Appeal if you received a warning." },
{ name: "๐Ÿ”‡ Mute Appeals", value: "Appeal if you were muted." },
{ name: "โŒ Ban Appeals", value: "Appeal if you were banned." }
);

const warnButton = new ButtonBuilder()
.setCustomId("warnappeal")
.setLabel("Warn Appeals")
.setStyle(ButtonStyle.Secondary)

const muteButton = new ButtonBuilder()
.setCustomId("muteappeal")
.setLabel("Mute Appeals")
.setStyle(ButtonStyle.Secondary)
.setEmoji({name: '๐Ÿ”‡'})

const banButton = new ButtonBuilder()
.setCustomId("banappeal")
.setLabel("Ban Appeals")
.setStyle(ButtonStyle.Secondary)

const row = new ActionRowBuilder()
.addComponents(warnButton, muteButton, banButton);

return {
embeds: [appealEmbed],
row: [row]
}
},
}
const { CommandType } = require("wokcommands");
const { EmbedBuilder, ButtonStyle, ButtonBuilder, ActionRowBuilder } = require("discord.js");

module.exports = {
// Required for slash commands
description: "Send the appeal embed.",

// Create a legacy and slash command
type: CommandType.BOTH,

// Invoked when a user runs the ping command
callback: () => {
const { MessageActionRow, MessageButton, MessageEmbed } = require('discord.js');

const appealEmbed = new EmbedBuilder()
.setTitle("Appeal A Moderator Action")
.setDescription("If you received a warning, mute, or ban and wish to appeal, use the buttons below based on your punishment.")
.addFields(
{ name: "โš ๏ธ Warn Appeals", value: "Appeal if you received a warning." },
{ name: "๐Ÿ”‡ Mute Appeals", value: "Appeal if you were muted." },
{ name: "โŒ Ban Appeals", value: "Appeal if you were banned." }
);

const warnButton = new ButtonBuilder()
.setCustomId("warnappeal")
.setLabel("Warn Appeals")
.setStyle(ButtonStyle.Secondary)

const muteButton = new ButtonBuilder()
.setCustomId("muteappeal")
.setLabel("Mute Appeals")
.setStyle(ButtonStyle.Secondary)
.setEmoji({name: '๐Ÿ”‡'})

const banButton = new ButtonBuilder()
.setCustomId("banappeal")
.setLabel("Ban Appeals")
.setStyle(ButtonStyle.Secondary)

const row = new ActionRowBuilder()
.addComponents(warnButton, muteButton, banButton);

return {
embeds: [appealEmbed],
row: [row]
}
},
}
No errors
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
In the return I do
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
But its how the command handler wants it Only this sends
lor3512
lor3512OPโ€ข8mo ago
No description
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
Ib thats the page Wait no
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
They are slow asf tho ๐Ÿ’€ Do you thing a regular channel.send would work
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
Let me try one thing Wait I found the error I did row: [row]
lor3512
lor3512OPโ€ข8mo ago
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
Ye
lor3512
lor3512OPโ€ข8mo ago
Works, thx
No description
lor3512
lor3512OPโ€ข8mo ago
Also can you do custom emojis In buttons
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docsโ€ข8mo ago
- Custom emojis: \:name: โžž <a:name:id> - Twemojis: \:name: โžž unicode representation - Emoji picker: WIN + . / CMD + CTRL + SPACE / CTRL + . - Right-clicking any emoji will not copy its id!
lor3512
lor3512OPโ€ข8mo ago
How? K Do I just edit the object to <name:id> Like that
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
Ahhh K
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
Works, tysm
lor3512
lor3512OPโ€ข8mo ago
No description
Unknown User
Unknown Userโ€ข8mo ago
Message Not Public
Sign In & Join Server To View
lor3512
lor3512OPโ€ข8mo ago
K, ima mark this as resolved.
Want results from more Discord servers?
Add your server