channel.isTextBased() is not a function

I have a ticket bot but by trying to open a ticket it gives me the following Error:
0|ticketer-backend | TypeError: channel.isTextBased is not a function
0|ticketer-backend | at InteractionCreateAction.handle (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/actions/InteractionCreate.js:46:33)
0|ticketer-backend | at module.exports [as INTERACTION_CREATE] (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
0|ticketer-backend | at WebSocketManager.handlePacket (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/websocket/WebSocketManager.js:352:31)
0|ticketer-backend | at WebSocketShard.onPacket (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/websocket/WebSocketShard.js:481:22)
0|ticketer-backend | at WebSocketShard.onMessage (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/websocket/WebSocketShard.js:321:10)
0|ticketer-backend | at WebSocket.onMessage (/home/ticketer-backend-main/ticketer-backend-main/node_modules/ws/lib/event-target.js:199:18)
0|ticketer-backend | at WebSocket.emit (node:events:512:28)
0|ticketer-backend | at Receiver.receiverOnMessage (/home/ticketer-backend-main/ticketer-backend-main/node_modules/ws/lib/websocket.js:1178:20)
0|ticketer-backend | at Receiver.emit (node:events:512:28)
0|ticketer-backend | at Receiver.dataMessage (/home/ticketer-backend-main/ticketer-backend-main/node_modules/ws/lib/receiver.js:528:14)
0|ticketer-backend | Node.js v20.4.0
0|ticketer-backend | TypeError: channel.isTextBased is not a function
0|ticketer-backend | at InteractionCreateAction.handle (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/actions/InteractionCreate.js:46:33)
0|ticketer-backend | at module.exports [as INTERACTION_CREATE] (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
0|ticketer-backend | at WebSocketManager.handlePacket (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/websocket/WebSocketManager.js:352:31)
0|ticketer-backend | at WebSocketShard.onPacket (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/websocket/WebSocketShard.js:481:22)
0|ticketer-backend | at WebSocketShard.onMessage (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/websocket/WebSocketShard.js:321:10)
0|ticketer-backend | at WebSocket.onMessage (/home/ticketer-backend-main/ticketer-backend-main/node_modules/ws/lib/event-target.js:199:18)
0|ticketer-backend | at WebSocket.emit (node:events:512:28)
0|ticketer-backend | at Receiver.receiverOnMessage (/home/ticketer-backend-main/ticketer-backend-main/node_modules/ws/lib/websocket.js:1178:20)
0|ticketer-backend | at Receiver.emit (node:events:512:28)
0|ticketer-backend | at Receiver.dataMessage (/home/ticketer-backend-main/ticketer-backend-main/node_modules/ws/lib/receiver.js:528:14)
0|ticketer-backend | Node.js v20.4.0
It looks like the error is at:
case InteractionType.MessageComponent:
if (channel && !channel.isTextBased()) return;
case InteractionType.MessageComponent:
if (channel && !channel.isTextBased()) return;
but i'm not sure how to fix it.
7 Replies
d.js toolkit
d.js toolkit2y ago
Use v14.11.0 or newer of discord.js: npm i discord.js@latest (more: https://discord.com/channels/222078108977594368/1091094485754187907/1091094485754187907 ) - 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. - Issue solved? Press the button!
Cgx
CgxOP2y ago
Newest discord.js version 14.11.0
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Cgx
CgxOP2y ago
Ok i just saw im on 14.5 Facepalm
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Cgx
CgxOP2y ago
Done and works Thank you anyways <a:wwe_pepe_heli:1109129134841528350>
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server