Premium

Code:
await message.channel.send({
embeds: [
new EmbedBuilder()
.setColor("DarkRed")
.setTimestamp()
.setAuthor({
name:
message.member?.user?.globalName ??
message.member?.user?.username ??
"Unknown User",
iconURL: message.member?.user?.displayAvatarURL() ?? "",
})
.setThumbnail(client.user.displayAvatarURL())
.setDescription("You do not have a Premium subscription to OGHub."),
],
components: [
{
type: 1,
components: [
{
type: 2,
style: 6,
sku_id: 1270342893235605524,
},
{
type: 2,
label: "Sign-up ...",
style: 5,
url: "https://.../en/auth/sign-up",
},
],
},
],
});
await message.channel.send({
embeds: [
new EmbedBuilder()
.setColor("DarkRed")
.setTimestamp()
.setAuthor({
name:
message.member?.user?.globalName ??
message.member?.user?.username ??
"Unknown User",
iconURL: message.member?.user?.displayAvatarURL() ?? "",
})
.setThumbnail(client.user.displayAvatarURL())
.setDescription("You do not have a Premium subscription to OGHub."),
],
components: [
{
type: 1,
components: [
{
type: 2,
style: 6,
sku_id: 1270342893235605524,
},
{
type: 2,
label: "Sign-up ...",
style: 5,
url: "https://.../en/auth/sign-up",
},
],
},
],
});
Error Code: RangeError: Buttons must have a label and/or an emoji at validateRequiredButtonParameters .
11 Replies
d.js toolkit
d.js toolkit•4mo 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!
Mark
Mark•4mo ago
including stack
OGHUB
OGHUBOP•4mo ago
What do you mean by "including stack"?
treble/luna
treble/luna•4mo ago
the stacktrace of the rror
OGHUB
OGHUBOP•4mo ago
Ah oops 😄
RangeError: Buttons must have a label and/or an emoji
at validateRequiredButtonParameters (/www/xxx/xxx/node_modules/@discordjs/builders/dist/index.js:556:11)
at ButtonBuilder.toJSON (/www/xx/xxx//node_modules/@discordjs/builders/dist/index.js:693:5)
at /www/xx/xxx//node_modules/@discordjs/builders/dist/index.js:1460:64
at Array.map (<anonymous>)
at ActionRowBuilder.toJSON (/www/xx/xxx//node_modules/@discordjs/builders/dist/index.js:1460:35)
at /www/xx/xxx//node_modules/discord.js/src/structures/MessagePayload.js:137:82
at Array.map (<anonymous>)
at MessagePayload.resolveBody (/www/xx/xxx//node_modules/discord.js/src/structures/MessagePayload.js:136:49)
at TextChannel.send (/www/xx/xxx//node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:151:61)
at premiumOnlyFN (file:///www/xx/xxx//src/structures/commandOptions/premiumOnly.js:34:27)
RangeError: Buttons must have a label and/or an emoji
at validateRequiredButtonParameters (/www/xxx/xxx/node_modules/@discordjs/builders/dist/index.js:556:11)
at ButtonBuilder.toJSON (/www/xx/xxx//node_modules/@discordjs/builders/dist/index.js:693:5)
at /www/xx/xxx//node_modules/@discordjs/builders/dist/index.js:1460:64
at Array.map (<anonymous>)
at ActionRowBuilder.toJSON (/www/xx/xxx//node_modules/@discordjs/builders/dist/index.js:1460:35)
at /www/xx/xxx//node_modules/discord.js/src/structures/MessagePayload.js:137:82
at Array.map (<anonymous>)
at MessagePayload.resolveBody (/www/xx/xxx//node_modules/discord.js/src/structures/MessagePayload.js:136:49)
at TextChannel.send (/www/xx/xxx//node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:151:61)
at premiumOnlyFN (file:///www/xx/xxx//src/structures/commandOptions/premiumOnly.js:34:27)
treble/luna
treble/luna•4mo ago
what is your djs version
OGHUB
OGHUBOP•4mo ago
v14.14.1
Syjalo
Syjalo•4mo ago
You can import disableValidators function from discord.js, call it and that should work, but discord.js doesn't support sku_id officially yet I recommend to switch to the dev version instead
OGHUB
OGHUBOP•4mo ago
Ok, but it is possible to make a call to discord.com directly via axios or other, isn't it? for the sku_id
Syjalo
Syjalo•4mo ago
Or you can use /core
OGHUB
OGHUBOP•4mo ago
okay, release date approx ? for this version okay
Want results from more Discord servers?
Add your server