greatalts
greatalts
Explore posts from servers
DIAdiscord.js - Imagine a boo! 👻
Created by greatalts on 11/13/2023 in #djs-questions
Setting up try catch for TypeError's
Lemme try
8 replies
DIAdiscord.js - Imagine a boo! 👻
Created by greatalts on 11/13/2023 in #djs-questions
Setting up try catch for TypeError's
ty
8 replies
DIAdiscord.js - Imagine a boo! 👻
Created by greatalts on 11/13/2023 in #djs-questions
Setting up try catch for TypeError's
ah oke
8 replies
DIAdiscord.js - Imagine a boo! 👻
Created by greatalts on 11/13/2023 in #djs-questions
Setting up try catch for TypeError's
Code block
const purchaseEmbed = await PURCHASE_EMBEDS.createPurchaseEmbed({
paymentMethod: paymentMethod
})

const productOptionMenu = await buildProductOptionsMenu();

try{
interaction.update(
{
embeds: [purchaseEmbed],
components: [new ActionRowBuilder().addComponents(
productOptionMenu
)]
}
)
}catch(err){
console.log(err)
console.log("ERERFDSFD")
}
break;
const purchaseEmbed = await PURCHASE_EMBEDS.createPurchaseEmbed({
paymentMethod: paymentMethod
})

const productOptionMenu = await buildProductOptionsMenu();

try{
interaction.update(
{
embeds: [purchaseEmbed],
components: [new ActionRowBuilder().addComponents(
productOptionMenu
)]
}
)
}catch(err){
console.log(err)
console.log("ERERFDSFD")
}
break;
8 replies
DIAdiscord.js - Imagine a boo! 👻
Created by greatalts on 11/13/2023 in #djs-questions
Setting up try catch for TypeError's
Stack Trace
C:\Users\paulk\Desktop\AltsGreatDiscordBot\node_modules\@discordjs\builders\dist\index.js:1310
components: this.components.map((component) => component.toJSON())
^

TypeError: Cannot read properties of undefined (reading 'toJSON')
at C:\Users\paulk\Desktop\AltsGreatDiscordBot\node_modules\@discordjs\builders\dist\index.js:1310:64
at Array.map (<anonymous>)
at ActionRowBuilder.toJSON (C:\Users\paulk\Desktop\AltsGreatDiscordBot\node_modules\@discordjs\builders\dist\index.js:1310:35)
at C:\Users\paulk\Desktop\AltsGreatDiscordBot\node_modules\discord.js\src\structures\MessagePayload.js:136:109
at Array.map (<anonymous>)
at MessagePayload.resolveBody (C:\Users\paulk\Desktop\AltsGreatDiscordBot\node_modules\discord.js\src\structures\MessagePayload.js:136:49)
at StringSelectMenuInteraction.update (C:\Users\paulk\Desktop\AltsGreatDiscordBot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:231:56)
at handleMenuSelect (C:\Users\paulk\Desktop\AltsGreatDiscordBot\src\Interactions\MenuSelects\handleMenuSelect.js:81:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.7.0
C:\Users\paulk\Desktop\AltsGreatDiscordBot\node_modules\@discordjs\builders\dist\index.js:1310
components: this.components.map((component) => component.toJSON())
^

TypeError: Cannot read properties of undefined (reading 'toJSON')
at C:\Users\paulk\Desktop\AltsGreatDiscordBot\node_modules\@discordjs\builders\dist\index.js:1310:64
at Array.map (<anonymous>)
at ActionRowBuilder.toJSON (C:\Users\paulk\Desktop\AltsGreatDiscordBot\node_modules\@discordjs\builders\dist\index.js:1310:35)
at C:\Users\paulk\Desktop\AltsGreatDiscordBot\node_modules\discord.js\src\structures\MessagePayload.js:136:109
at Array.map (<anonymous>)
at MessagePayload.resolveBody (C:\Users\paulk\Desktop\AltsGreatDiscordBot\node_modules\discord.js\src\structures\MessagePayload.js:136:49)
at StringSelectMenuInteraction.update (C:\Users\paulk\Desktop\AltsGreatDiscordBot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:231:56)
at handleMenuSelect (C:\Users\paulk\Desktop\AltsGreatDiscordBot\src\Interactions\MenuSelects\handleMenuSelect.js:81:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.7.0
8 replies