Mercenary Ike
Mercenary Ike
SIASapphire - Imagine a framework
Created by Mercenary Ike on 4/21/2023 in #sapphire-support
Expected a string primitive when creating StringSelectMenu
9 replies
SIASapphire - Imagine a framework
Created by Mercenary Ike on 4/21/2023 in #sapphire-support
Expected a string primitive when creating StringSelectMenu
I suspect this is the area where this error comes up
public static GetInteraction(channelID: string) {
const actionRow = new ActionRowBuilder<StringSelectMenuBuilder>()
.addComponents( new StringSelectMenuBuilder()
.addOptions([
// ...tactics,
new StringSelectMenuOptionBuilder()
.setLabel('label')
.setEmoji('🛡️')
.setLabel("Hold")
.setDescription("description")
.setValue("hold"),
new StringSelectMenuOptionBuilder()
.setLabel('label')
.setEmoji('🙇')
.setLabel("Recover")
.setDescription("description")
.setValue("recover")
]))

console.log("Action row built:", actionRow.components[0].options)
return { embeds: [this.GetCurrentStatusEmbed(channelID)], components: [actionRow] };
}
public static GetInteraction(channelID: string) {
const actionRow = new ActionRowBuilder<StringSelectMenuBuilder>()
.addComponents( new StringSelectMenuBuilder()
.addOptions([
// ...tactics,
new StringSelectMenuOptionBuilder()
.setLabel('label')
.setEmoji('🛡️')
.setLabel("Hold")
.setDescription("description")
.setValue("hold"),
new StringSelectMenuOptionBuilder()
.setLabel('label')
.setEmoji('🙇')
.setLabel("Recover")
.setDescription("description")
.setValue("recover")
]))

console.log("Action row built:", actionRow.components[0].options)
return { embeds: [this.GetCurrentStatusEmbed(channelID)], components: [actionRow] };
}
9 replies
SIASapphire - Imagine a framework
Created by Mercenary Ike on 4/21/2023 in #sapphire-support
Expected a string primitive when creating StringSelectMenu
The error is as such
[ERROR] Encountered error on chat input command "start" at path "C:\Users\tszmi\Documents\Code\EVE\src\commands\start.ts" ValidationError > s.string
Expected a string primitive

Received:
| undefined

at StringValidator.handle (C:\Users\tszmi\Documents\Code\EVE\node_modules\@sapphire\shapeshift\src\validators\StringValidator.ts:65:59)
at StringValidator.parse (C:\Users\tszmi\Documents\Code\EVE\node_modules\@sapphire\shapeshift\src\validators\BaseValidator.ts:92:2)
at validateRequiredSelectMenuParameters (C:\Users\tszmi\Documents\Code\EVE\node_modules\@discordjs\builders\src\components\Assertions.ts:60:20)
at StringSelectMenuBuilder.toJSON (C:\Users\tszmi\Documents\Code\EVE\node_modules\@discordjs\builders\src\components\selectMenu\StringSelectMenu.ts:142:3)
at map (C:\Users\tszmi\Documents\Code\EVE\node_modules\@discordjs\builders\src\components\ActionRow.ts:113:61)
at Array.map (<anonymous>)
at ActionRowBuilder.toJSON (C:\Users\tszmi\Documents\Code\EVE\node_modules\@discordjs\builders\src\components\ActionRow.ts:113:32)
at C:\Users\tszmi\Documents\Code\EVE\node_modules\discord.js\src\structures\MessagePayload.js:137:109
at Array.map (<anonymous>)
at MessagePayload.resolveBody (C:\Users\tszmi\Documents\Code\EVE\node_modules\discord.js\src\structures\MessagePayload.js:137:49)
[ERROR] Encountered error on chat input command "start" at path "C:\Users\tszmi\Documents\Code\EVE\src\commands\start.ts" ValidationError > s.string
Expected a string primitive

Received:
| undefined

at StringValidator.handle (C:\Users\tszmi\Documents\Code\EVE\node_modules\@sapphire\shapeshift\src\validators\StringValidator.ts:65:59)
at StringValidator.parse (C:\Users\tszmi\Documents\Code\EVE\node_modules\@sapphire\shapeshift\src\validators\BaseValidator.ts:92:2)
at validateRequiredSelectMenuParameters (C:\Users\tszmi\Documents\Code\EVE\node_modules\@discordjs\builders\src\components\Assertions.ts:60:20)
at StringSelectMenuBuilder.toJSON (C:\Users\tszmi\Documents\Code\EVE\node_modules\@discordjs\builders\src\components\selectMenu\StringSelectMenu.ts:142:3)
at map (C:\Users\tszmi\Documents\Code\EVE\node_modules\@discordjs\builders\src\components\ActionRow.ts:113:61)
at Array.map (<anonymous>)
at ActionRowBuilder.toJSON (C:\Users\tszmi\Documents\Code\EVE\node_modules\@discordjs\builders\src\components\ActionRow.ts:113:32)
at C:\Users\tszmi\Documents\Code\EVE\node_modules\discord.js\src\structures\MessagePayload.js:137:109
at Array.map (<anonymous>)
at MessagePayload.resolveBody (C:\Users\tszmi\Documents\Code\EVE\node_modules\discord.js\src\structures\MessagePayload.js:137:49)
9 replies
SIASapphire - Imagine a framework
Created by Mercenary Ike on 2/15/2023 in #sapphire-support
Is it possible to update slash command string options every time the command is ran?
5 replies