CombinedPropertyError? when trying to use a function that uses JSDOM to return a string for embed

Hello! I have a problem so my code is giving me multiple CombinedPropertyError idk whats that but I used some async functions to get the descriptions to give to my embed
export async function handleWhatIsCommand(interaction) {
const tank = interaction.options.get("tank").value;
const designText = await getAllInfoThenGetText(tank, 'Design')
const technicalText = await getAllInfoThenGetText(tank, 'Technical')
...

embedTemplate.addFields(
{
name: "Design",
value: designText
},
{
name: "Technical",
value: technicalText
}
);
export async function handleWhatIsCommand(interaction) {
const tank = interaction.options.get("tank").value;
const designText = await getAllInfoThenGetText(tank, 'Design')
const technicalText = await getAllInfoThenGetText(tank, 'Technical')
...

embedTemplate.addFields(
{
name: "Design",
value: designText
},
{
name: "Technical",
value: technicalText
}
);
and the getAllInfoFrom<wiki>API uses JSDOM (an npm package that can like make a fake dom, need to use it to get the text content from mediawiki apI) maybe that npm is doing something idk but when i tried using it in here
async function main() {
const commands = [whatis];

try {
console.log("Started refreshing application (/) commands.");
await rest.put(Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID), {
body: commands,
});
// -------------------
let test = getAllInfoThenGetText(someparamshere........)
console.log(test)
// -------------------
client.login(BOT_TOKEN);
} catch (error) {
console.error(error);
}
}

main();
async function main() {
const commands = [whatis];

try {
console.log("Started refreshing application (/) commands.");
await rest.put(Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID), {
body: commands,
});
// -------------------
let test = getAllInfoThenGetText(someparamshere........)
console.log(test)
// -------------------
client.login(BOT_TOKEN);
} catch (error) {
console.error(error);
}
}

main();
it outputted the data to the terminal console just fine Full Error:
18 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
trplnr
trplnrOP2y ago
node 18.16.1
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
trplnr
trplnrOP2y ago
wdym?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
trplnr
trplnrOP2y ago
trplnr
trplnrOP2y ago
export async function handleWhatIsCommand(interaction) {
const tank = interaction.options.get("tank").value;
const designText = await getAllInfoThenGetText(tank, 'Design')
const technicalText = await getAllInfoThenGetText(tank, 'Technical')

const embedTemplate = new EmbedBuilder()
.setColor(0x3ca4cb)
.setTitle(tank)
.setURL(`https://diepio.fandom.com/wiki/Arras:${tank}`)
.setDescription(
`Default Description, Oh no! You found a bug! This may be caused because I didnt put a description yet or something went wrong. Please report it to @trplnr`
)
.setImage(convertTankToDiepIoWikiImageUrl(tank));
embedTemplate.addFields(
{
name: "Design",
value: designText
},
{
name: "Technical",
value: technicalText
}
);
interaction.reply({ embeds: [embedTemplate] });

}
export async function handleWhatIsCommand(interaction) {
const tank = interaction.options.get("tank").value;
const designText = await getAllInfoThenGetText(tank, 'Design')
const technicalText = await getAllInfoThenGetText(tank, 'Technical')

const embedTemplate = new EmbedBuilder()
.setColor(0x3ca4cb)
.setTitle(tank)
.setURL(`https://diepio.fandom.com/wiki/Arras:${tank}`)
.setDescription(
`Default Description, Oh no! You found a bug! This may be caused because I didnt put a description yet or something went wrong. Please report it to @trplnr`
)
.setImage(convertTankToDiepIoWikiImageUrl(tank));
embedTemplate.addFields(
{
name: "Design",
value: designText
},
{
name: "Technical",
value: technicalText
}
);
interaction.reply({ embeds: [embedTemplate] });

}
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
trplnr
trplnrOP2y ago
trplnr
trplnrOP2y ago
hmm where does the 1,2 and the undefineds come from
trplnr
trplnrOP2y ago
i modified the function that gets the text and it seems that it repeated these twice but without the 1 and 2
trplnr
trplnrOP2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
trplnr
trplnrOP2y ago
(also when i was testing the api calls and the functions on a separate file it worked fine) k Oh the repeated texts is from a console.log i forgot to remove but i removed it and heres the output
trplnr
trplnrOP2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
trplnr
trplnrOP2y ago
oh my god it works now thanks
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server