#New error magically appeared xD

51 messages · Page 1 of 1 (latest)

chilly rampart
#

About to 40 minutes ago my bot crashed with a very uncommon error. Then tried to restart it and now it keeps crashing with same error. No changes in code were made, so my first thought is that discord updated something in his API.

Here is the error code

C:\Users\Leona\Desktop\dashboard_bot\node_modules\discord.js\src\client\actions\InteractionCreate.js:50
        if (channel && !channel.isTextBased()) return;
                                ^

TypeError: channel.isTextBased is not a function
    at InteractionCreateAction.handle (C:\Users\Leona\Desktop\dashboard_bot\node_modules\discord.js\src\client\actions\InteractionCreate.js:50:33)
    at Object.module.exports [as INTERACTION_CREATE] (C:\Users\Leona\Desktop\dashboard_bot\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)

Anyone knows what could happened? The error is inside the node modules

warm viper
#

• 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.

chilly rampart
orchid ether
#

#769862166131245066

chilly rampart
#

Lol

#

My bad

#

Also, there is a doc about how to update the modules?

#

Just run the npm install discord.js?

plain gyro
#

@unkempt basin

#

bruh

plain gyro
chilly rampart
#

Thanks

empty heath
#

i used that and it now sends npm errors

plain gyro
#

what error?

empty heath
#
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2023-03-29T20_27_03_036Z-debug-0.log

C:\Users\Administrator\Desktop\ticket bot\BotFiles>npm i discord.js@latest
npm ERR! code ENOTEMPTY
npm ERR! syscall rmdir
npm ERR! path C:\Users\Administrator\Desktop\ticket bot\BotFiles\node_modules\discord.js\src
npm ERR! errno -4051
npm ERR! ENOTEMPTY: directory not empty, rmdir 'C:\Users\Administrator\Desktop\ticket bot\BotFiles\node_modules\discord.js\src'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2023-03-29T20_27_43_836Z-debug-0.log

#

idk about that ...

chilly rampart
#

Not sure

empty heath
#

it says he cant find the path

chilly rampart
#

Indeed it says it cannot be deleted because its not empty "ENOTEMPTY: directory not empty", maybe you should manually delete it?

empty heath
#

just delete the path ?

chilly rampart
#

The discord.js folder that is located inside your node_modules

empty heath
#

yea found it just delete ?

chilly rampart
#

Yes

#

Its just a guess, i have no idea if i'm talking shit

empty heath
#

dont think i need to delete it 🤔

chilly rampart
#

My guess is delete then reinstall the discord js by the command they sent

empty heath
mossy hatch
#

nobody send to run npm fund did we...

empty heath
#

idk

#

thats the error when i use the update latest command

C:\Users\Administrator\Desktop\darkhorizon MOD\BotFiles>npm install discord.js@latest

added 15 packages, removed 82 packages, changed 11 packages, and audited 125 packages in 9s

6 packages are looking for funding
  run `npm fund` for details

5 vulnerabilities (1 moderate, 4 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
mossy hatch
#

Thats not an error

empty heath
#

got this error after starting the bot

TypeError: Cannot read properties of undefined (reading 'FLAGS')
    at Object.<anonymous> (C:\Users\Administrator\Desktop\darkhorizon MOD\BotFiles\bot.js:36:25)
    at Module._compile (node:internal/modules/cjs/loader:1226:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
    at Module.load (node:internal/modules/cjs/loader:1089:32)
    at Module._load (node:internal/modules/cjs/loader:930:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47
mossy hatch
#

Okay so you were previously on v13

#

You should update to the latest v13, not v14

empty heath
#

so i use that ?
npm i discord.js@v13-lts

wooden drum
#

I'm getting the same issue as the OP. I think that this a bug in Discord.js, due to a Discord API update

My exact versions:

discord.js 14.6.0```
empty heath
#

....

empty heath
#

im so stupid

mossy hatch
#

To latest v14 in your case

wooden drum
#

Update in production successful --- everyone else should try something like npm i discord.js@"<15.0.0" if you're on major version 14

orchid ether
wooden drum
#

So it is. No v15 yet lol

#

But v13 people can follow the sample template

modest frigate
#

just fyi we had the same problem (started happening today) running v14.6.0 in production. upgrading to v14.8.0 fixed it.

#

so it may not be just users running v13 who are affected

flint gazelle
#

The last two messages in #announcements are that it was fixed in latest v13 and latest v14 respectively