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
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...
- 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[email protected]
v20.10.0
Also if possible, idk if you can do custom emojis in it.
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
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โข8mo ago
Message Not Public
Sign In & Join Server To View
How?
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
Kinda
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
AHHHHH
const { CommandType } = require("wokcommands");
const { EmbedBuilder, ButtonStyle } = require("discord.js");
const { ButtonBuilder, ActionRowBuilder } = require("@discordjs/builders");
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
discord.js includes multiple sub-packages, installing these separately can mess with internal code:
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
K
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
Now it dosent send the buttons
No errors
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
In the return I do
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
But its how the command handler wants it
Only this sends
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
Ib thats the page
Wait no
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
They are slow asf tho ๐
Do you thing a regular channel.send would work
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
Let me try one thing
Wait I found the error
I did row: [row]
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
Ye
Works, thx
Also can you do custom emojis
In buttons
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
- 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!How?
K
Do I just edit the object to <name:id>
Like that
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
Ahhh
K
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
Works, tysm
Unknown Userโข8mo ago
Message Not Public
Sign In & Join Server To View
K, ima mark this as resolved.