Trying to add guild emoji to button getting error

ValidationError > s.object(T)
Expected the value to be an object, but received string instead

Received:
| '1199478685825253396'
ValidationError > s.object(T)
Expected the value to be an object, but received string instead

Received:
| '1199478685825253396'
using it here
const row = new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setLabel('Watch on Twitch')
.setURL(`https://twitch.tv/${channel.user_name}`)
.setStyle(ButtonStyle.Link)
.setEmoji('1199478685825253396')
);
const row = new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setLabel('Watch on Twitch')
.setURL(`https://twitch.tv/${channel.user_name}`)
.setStyle(ButtonStyle.Link)
.setEmoji('1199478685825253396')
);
here is what i imported
const { ButtonBuilder } = require('@discordjs/builders');
const axios = require('axios');
const { EmbedBuilder , ActionRowBuilder , ButtonStyle } = require('discord.js');
const discordModule = require('../discordModule');
const { ButtonBuilder } = require('@discordjs/builders');
const axios = require('axios');
const { EmbedBuilder , ActionRowBuilder , ButtonStyle } = require('discord.js');
const discordModule = require('../discordModule');
3 Replies
d.js toolkit
d.js toolkit5mo 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!
duck
duck5mo ago
you'll need to import ButtonBuilder from discord.js rather than @discordjs/builders if you want it to be able to resolve emoji data for you
VEGA
VEGA5mo ago
oh awesome