TypeError: pendingTicketsChannel.createChannel is not a function

This used to work, but discordjs has been updated throughout the years and now it just throws the following terminal error.
node:events:497
throw er; // Unhandled 'error' event
^

TypeError: pendingTicketsChannel.createChannel is not a function
at Client.<anonymous> (C:\Users\em08p\Downloads\bot\index.js:73:66)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:402:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)
node:events:497
throw er; // Unhandled 'error' event
^

TypeError: pendingTicketsChannel.createChannel is not a function
at Client.<anonymous> (C:\Users\em08p\Downloads\bot\index.js:73:66)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:402:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)
10 Replies
d.js toolkit
d.js toolkit7mo 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
monbrey
monbrey7mo ago
That wouldn't have worked since about v11 guild.channels.create is how you do it currently
.
.OP7mo ago
so like. pendingTicketsChannel.guild.channels.create like i dont code
monbrey
monbrey7mo ago
I don't know what pendingTicketsChannel is If you don't code it's going to be very hard to help you
.
.OP7mo ago
i know like a bit.. does this answer that question.
const bugReportChannel = await pendingTicketsChannel.createChannel(`bug-report-${currentTicketNumber}`, {
type: 'GUILD_TEXT',
permissionOverwrites: [
{
id: member.id,
allow: ["SEND_MESSAGES", "VIEW_CHANNEL", "READ_MESSAGE_HISTORY", "ATTACH_FILES", "EMBED_LINKS"],
deny: ["USE_APPLICATION_COMMANDS", "CREATE_PUBLIC_THREADS", "CREATE_PRIVATE_THREADS"]
},
{
id: reaction.message.channel.guild.id,
deny: ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY"],
},
],
});
const bugReportChannel = await pendingTicketsChannel.createChannel(`bug-report-${currentTicketNumber}`, {
type: 'GUILD_TEXT',
permissionOverwrites: [
{
id: member.id,
allow: ["SEND_MESSAGES", "VIEW_CHANNEL", "READ_MESSAGE_HISTORY", "ATTACH_FILES", "EMBED_LINKS"],
deny: ["USE_APPLICATION_COMMANDS", "CREATE_PUBLIC_THREADS", "CREATE_PRIVATE_THREADS"]
},
{
id: reaction.message.channel.guild.id,
deny: ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY"],
},
],
});
monbrey
monbrey7mo ago
No, doesn't show me what it is. But it implies it's probably a guild. There's a lot more than that which needs updating here though, likely the entire bot Why was it updated to v14?
.
.OP7mo ago
thought to update it to the latest,
monbrey
monbrey7mo ago
You jumped three major versions There are going to be a huge number of changes to make
.
.OP7mo ago
alright i get that. is there like any way to use older versions
Kevinnnn
Kevinnnn7mo ago
not really, and you wouldn't get any support for them since v11 has been unsupported for a few years now v13 is currently the oldest major version still supported, v14 is the current major version
Want results from more Discord servers?
Add your server