#Client not defined in module export?

13 messages · Page 1 of 1 (latest)

proud wolfBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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!
broken oyster
#

first of all, why do you need al intents.
Second, dont export yout client. Use the ready event and call a function where you initialize

#

third, perms are PascalCase

#

and hasPermissions doesnt exist

#

you also do not need to fetch guilds, they are al cached

gilded knot
# broken oyster first of all, why do you need al intents. Second, dont export yout client. Use t...
  1. I'm mainly doing it for testing so i dont have to worry about getting the intents i need.
  2. Don't you require the client to call a ready event? The index.js and this handler file are in completely separate directories (You may have to explain this further, i dont quite understand it yet <3)
  3. Thank you, I thought they were capitalised 💜
  4. Thank you again :D I thought they weren’t cached, I think i' getting mixed up with DMS and guilds
broken oyster
#

the ready event fires with a client, ideally you'd have an event handler in your index.js file that calls all events

#

if you use the ready event you will be sure to have a fully ready client

crystal orbitBOT
broken oyster
#

and if you have the guilds intent, all guilds, channels and roles are cached

#

members etc arent guaranteed to be cached so these still have to be fetched

gilded knot
gilded knot