.setActivity not working for me
For some reason i am getting the error Cannot read properties of null (reading 'setActivity') even though i have used const { Client, GatewayIntentBits, ActivityType } = require('discord.js');
3 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- 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!Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
I fixed it thankfully, I forgot to remove a previous instance of the line client.user.setActivity('activity', { type: ActivityType.Watching }); so it was trying to execute before my bot was online as you just mentioned, everything is running as intended now thank you.