File Sending

const transcript = await createTranscript(interaction.channel, {
fileName: `transcript-${interaction.channel.name}.html`,
limit: -1,
returnType: 'attachment',
}).then(() => {
debug("Transcript opgeslagen")
})
const transcript = await createTranscript(interaction.channel, {
fileName: `transcript-${interaction.channel.name}.html`,
limit: -1,
returnType: 'attachment',
}).then(() => {
debug("Transcript opgeslagen")
})
This code gives this error when sending the file in a message:
C:\Users\Gebruiker\Desktop\Code\ticket-bot\Ticket-Bot-Cartel\node_modules\discord.js\src\structures\MessagePayload.js:191
description: file.description,
^

TypeError: Cannot read properties of undefined (reading 'description')
at C:\Users\Gebruiker\Desktop\Code\ticket-bot\Ticket-Bot-Cartel\node_modules\discord.js\src\structures\MessagePayload.js:191:25
at Array.map (<anonymous>)
at MessagePayload.resolveData (C:\Users\Gebruiker\Desktop\Code\ticket-bot\Ticket-Bot-Cartel\node_modules\discord.js\src\structures\MessagePayload.js:189:45)
at TextChannel.send (C:\Users\Gebruiker\Desktop\Code\ticket-bot\Ticket-Bot-Cartel\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:154:61)
at func_createTranscript (C:\Users\Gebruiker\Desktop\Code\ticket-bot\Ticket-Bot-Cartel\events\ticketButtons.js:40:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v21.4.0
C:\Users\Gebruiker\Desktop\Code\ticket-bot\Ticket-Bot-Cartel\node_modules\discord.js\src\structures\MessagePayload.js:191
description: file.description,
^

TypeError: Cannot read properties of undefined (reading 'description')
at C:\Users\Gebruiker\Desktop\Code\ticket-bot\Ticket-Bot-Cartel\node_modules\discord.js\src\structures\MessagePayload.js:191:25
at Array.map (<anonymous>)
at MessagePayload.resolveData (C:\Users\Gebruiker\Desktop\Code\ticket-bot\Ticket-Bot-Cartel\node_modules\discord.js\src\structures\MessagePayload.js:189:45)
at TextChannel.send (C:\Users\Gebruiker\Desktop\Code\ticket-bot\Ticket-Bot-Cartel\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:154:61)
at func_createTranscript (C:\Users\Gebruiker\Desktop\Code\ticket-bot\Ticket-Bot-Cartel\events\ticketButtons.js:40:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v21.4.0
Message sending:
await transcriptChannel.send({embeds: [
new MessageEmbed()
.setAuthor({name: member.user.tag, iconURL: member.user.displayAvatarURL({dynamic: true})})
.addField("Ticket Owner", `<@${userData.ownerID}>`, true)
.addField("Ticket Name", interaction.channel.name, true)
.setColor("ORANGE")
], files: [transcript]}).then((msg) => {
msg.edit({embeds: [
msg.embeds[0]
.addField("Panel Name", `${userData.ticketPanel}`, true)
.addField("Direct Transcript", `[Direct Transcript](${msg.attachments.first().url})`, true)
.addField("Ticket Closed", interaction.user.tag, true)
.setColor("GREEN")
]});
});
await transcriptChannel.send({embeds: [
new MessageEmbed()
.setAuthor({name: member.user.tag, iconURL: member.user.displayAvatarURL({dynamic: true})})
.addField("Ticket Owner", `<@${userData.ownerID}>`, true)
.addField("Ticket Name", interaction.channel.name, true)
.setColor("ORANGE")
], files: [transcript]}).then((msg) => {
msg.edit({embeds: [
msg.embeds[0]
.addField("Panel Name", `${userData.ticketPanel}`, true)
.addField("Direct Transcript", `[Direct Transcript](${msg.attachments.first().url})`, true)
.addField("Ticket Closed", interaction.user.tag, true)
.setColor("GREEN")
]});
});
3 Replies
d.js toolkit
d.js toolkit3mo 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! - Marked as resolved by staff
JulianRJC
JulianRJCOP3mo ago
├─┬ [email protected] │ └── [email protected] deduped └── [email protected] Node: v21.4.0
Mark
Mark3mo ago
We don't offer support for v13 any more (see #archive-djs-help-v13 ) and recommend you update to v14
Want results from more Discord servers?
Add your server