I have djs @ v12 just because everything is just getting more hard to learn every new update.
[nodemon] 2.0.22
[nodemon] to restart at any time, enter
rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node src/index.js
C:\Users\Joshua\Desktop\discordbot2\src\index.js:11
command(client, 'ping', message => {
^
TypeError: command is not a function
120 Replies
• 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.Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
too difficult the basics changed to me
you need to add some weird intentbit stuff or sm
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
what are the basics of v14
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
whats the easiest library?
i know that
is the + like what to do?
from the changes
cus theres + and -
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
and the + is what i use now?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
and sorry 1 more thing do i still use module.exports for my command handler
the reason i downgraded djs is because my slash commands dont work!
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
sooo yea?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
"REST"
like they just werent registering
therefore, I downgraded
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
is v13 supported tho?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
and how do i upgrade to v14?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
i am
it just says i have to uninstall it
still v13
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yea so i uninstalled it and its still v13
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
k thanks
and the documentation is for v14 right?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
kk ty
omg im so sorry
can i still use config.json file for my prefix and token or should i use .env
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
so both still work?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
k ty
and this is what I mean
PS C:\Users\Joshua\Desktop\discordbot2> nodemon
[nodemon] 2.0.22
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node src/index.js`
C:\Users\Joshua\Desktop\discordbot2\node_modules\discord.js\src\client\Client.js:492
throw new DiscordjsTypeError(ErrorCodes.ClientMissingIntents);
^
TypeError [ClientMissingIntents]: Valid intents must be provided for the Client.
at Client._validateOptions (C:\Users\Joshua\Desktop\discordbot2\node_modules\discord.js\src\client\Client.js:492:13)
at new Client (C:\Users\Joshua\Desktop\discordbot2\node_modules\discord.js\src\client\Client.js:78:10)
at Object.<anonymous> (C:\Users\Joshua\Desktop\discordbot2\src\index.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
code: 'ClientMissingIntents'
}
Node.js v18.16.1
[nodemon] app crashed - waiting for file changes before starting...
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
they are
now it says token invalid but i literally just reset it
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
oops i didnt copy that part
its there tho
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yea
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yea
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
it says token invalid
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
it does
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
ok
it wasnt the full token tho
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
you dont see that?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
bro its not even half of the token
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
it kind of does you need the whole token to do anything
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I already did reset it
twice now
and i put the new token in both times
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yes
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
where
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
index?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
im confused
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yes i did that
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yes i do
it worked when i just used client.login( token here )
so its the right token
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
its the correct token
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
ITS THE SAME TOKEN LMFAO
is it formatted correctly?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
so no ""?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
fawg..
dawg*
its still not working
sooooo?
do you know that your current isn’t related to discord.js at all?
like doesn’t even matter v12 or v50
bro what
your issue is related to dotenv (or just your JS knowledge ?)
i mean both I want to learn
but the dotenv isnt working
at all
it worked when i had v12
no no
^
i know its not related to the version im saying it worked perfectly fine last night
does it return an error?
yes
i already sent it
where
remove
client.login(…)
and replace it by console.log(process.env)
.TOKEN?
no
just process.env
um its showing my pc stuff
you don’t see your token in the terminal?
no
just two sec I'm gonna move on my PC
ok
the following code sample is working for me
that's my .env
can i use (c) instead of (client)?
and thats exaclty what I have
then something wrong in your side
not the library's side
name your params however you want
ill try resetting my token one more time
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
mines
me too
^
^
sooooooooooooo what do i do
i dont get the error any more but it says
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
you don't get the error because I told you to remove your client.login(...)
when i try to node .
oh yea
u can infact have it as string
no whitespace, all caps is the general formatting
also use unique names, nothing that other programs or the OS could set
do i need to use a config file or env file if I dont put it on github?
please start moving to #other-js-ts
nothing related to djs now
mby try moving .env in ur root directory instead of ./src but idk if that makes a difference