- What's your exact discord.js
npm list discord.jsand nodenode -vversion? - 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!
#Client not defined in module export?
13 messages · Page 1 of 1 (latest)
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
- I'm mainly doing it for testing so i dont have to worry about getting the intents i need.
- 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)
- Thank you, I thought they were capitalised 💜
- Thank you again :D I thought they weren’t cached, I think i' getting mixed up with DMS and guilds
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
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
Mhm mhm!! i think thats where i got confused with that one :O
i'm gonna try learn a lil more about it because in honesty it confused me pff 
but thank you for helpin me so far, i might come back with a few questions about the client stoof tho <3
Creating Your Bot: Event handling