TypeError: ticket.send is not a function

Can someone help me?
export async function transcriptTicket(language, interaction, reason = null) {
const ticket = interaction.guild.channels.fetch(process.env.TICKET_TRANSCRIPTS_CHANNEL_ID);
const category = ticketEmbed.embeds[0].title.split('|')[1]?.trim();

const embed = new EmbedBuilder()
.setTitle(msg[language]['embedTitle'])
.setColor(process.env.COLOR_SUMMARY)
.addFields(
{ name: msg[language]['category'], value: `${(category === null) ? msg[language]['undefined'] : category}`, inline: true },
{ name: msg[language]['created'], value: `<t:${Math.floor(new Date(interaction.channel.createdAt).getTime() / 1000)}:R>`, inline: true },
{ name: msg[language]['opened_by'], value: `<@${interaction.channel.topic}>`, inline: true },
{ name: msg[language]['closed_by'], value: `<@${interaction.user.id}>`, inline: true },
{ name: msg[language]['reason'], value: `${(reason === null) ? msg[language]['undefined'] : reason}`, inline: true}
)
.setFooter({ text: interaction.guild.name, iconURL: interaction.guild.iconURL() })
.setTimestamp();

await ticket.send({ embeds: [embed] });

const ticket_user = await interaction.guild.members.fetch(interaction.channel.topic);
await ticket_user.send({ embeds: [embed] }).catch(err => {});
};
export async function transcriptTicket(language, interaction, reason = null) {
const ticket = interaction.guild.channels.fetch(process.env.TICKET_TRANSCRIPTS_CHANNEL_ID);
const category = ticketEmbed.embeds[0].title.split('|')[1]?.trim();

const embed = new EmbedBuilder()
.setTitle(msg[language]['embedTitle'])
.setColor(process.env.COLOR_SUMMARY)
.addFields(
{ name: msg[language]['category'], value: `${(category === null) ? msg[language]['undefined'] : category}`, inline: true },
{ name: msg[language]['created'], value: `<t:${Math.floor(new Date(interaction.channel.createdAt).getTime() / 1000)}:R>`, inline: true },
{ name: msg[language]['opened_by'], value: `<@${interaction.channel.topic}>`, inline: true },
{ name: msg[language]['closed_by'], value: `<@${interaction.user.id}>`, inline: true },
{ name: msg[language]['reason'], value: `${(reason === null) ? msg[language]['undefined'] : reason}`, inline: true}
)
.setFooter({ text: interaction.guild.name, iconURL: interaction.guild.iconURL() })
.setTimestamp();

await ticket.send({ embeds: [embed] });

const ticket_user = await interaction.guild.members.fetch(interaction.channel.topic);
await ticket_user.send({ embeds: [embed] }).catch(err => {});
};
1 Reply
d.js toolkit
d.js toolkit4d 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 OP

Did you find this page helpful?