Premium Button didn't work

Hi, there, First of all, I haven't found any documentation on how the Premium button works. Secondly, I have a problem (Expected the value to be a string or number) for the “Premium” button type. My code:
await interaction.reply({
embeds: [
new EmbedBuilder()
.setColor("DarkRed")
.setTimestamp()
.setAuthor({
name:
interaction.user.globalName ??
interaction.user.username ??
"Unknown User",
iconURL: interaction.user.displayAvatarURL() ?? "",
})
.setThumbnail(client.user.displayAvatarURL())
.setDescription("You do not have a Premium subscription to OGHub."),
],
components: [
new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setStyle(ButtonStyle.Premium)
.setSKUId("1270342893235605524"),
new ButtonBuilder()
.setLabel("Sign-up")
.setStyle(ButtonStyle.Link)
.setURL("https://...")
),
],
});
await interaction.reply({
embeds: [
new EmbedBuilder()
.setColor("DarkRed")
.setTimestamp()
.setAuthor({
name:
interaction.user.globalName ??
interaction.user.username ??
"Unknown User",
iconURL: interaction.user.displayAvatarURL() ?? "",
})
.setThumbnail(client.user.displayAvatarURL())
.setDescription("You do not have a Premium subscription to OGHub."),
],
components: [
new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setStyle(ButtonStyle.Premium)
.setSKUId("1270342893235605524"),
new ButtonBuilder()
.setLabel("Sign-up")
.setStyle(ButtonStyle.Link)
.setURL("https://...")
),
],
});
Full error:
ValidationError > s.nativeEnum(T)
Expected the value to be a string or number

Received:
| undefined

at _NativeEnumValidator.handle (node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:2634:25)
at _NativeEnumValidator.parse (node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:939:90)
at ButtonBuilder.setStyle (node_modules/@discordjs/builders/dist/index.js:636:44)
at checkPremium (src/structures/commandOptions/checkPremium.js:66:14)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.run (src/interactions/slashCommands/premium.js:33:30)
ValidationError > s.nativeEnum(T)
Expected the value to be a string or number

Received:
| undefined

at _NativeEnumValidator.handle (node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:2634:25)
at _NativeEnumValidator.parse (node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:939:90)
at ButtonBuilder.setStyle (node_modules/@discordjs/builders/dist/index.js:636:44)
at checkPremium (src/structures/commandOptions/checkPremium.js:66:14)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.run (src/interactions/slashCommands/premium.js:33:30)
Version : Latest (v14.16.x)
4 Replies
d.js toolkit
d.js toolkit4mo 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!
Kinect3000
Kinect30004mo ago
Can you run npm why discord-api-types?
OGHUB
OGHUBOP4mo ago
No description
Kinect3000
Kinect30004mo ago
Where did you import ButtonStyle from? Might be @discordjs/ws holding back ur discord-api-types version Premium buttons were added in 0.37.90
Want results from more Discord servers?
Add your server