Need help on a Auto role bot.

this is my current code, and it keeps giving this error when i join the server. Can I have help? node:events:496 throw er; // Unhandled 'error' event ^ ReferenceError: member is not defined at Client.<anonymous> (C:\Users\btrah\Desktop\Auto-Role Bot\auto-role-bot.js:16:14) at Client.emit (node:events:518:28) at module.exports [as GUILD_MEMBER_ADD] (C:\Users\btrah\node_modules\discord.js\src\client\websocket\handlers\GUILD_MEMBER_ADD.js:17:14) at WebSocketManager.handlePacket (C:\Users\btrah\node_modules\discord.js\src\client\websocket\WebSocketManager.js:351:31) at WebSocketManager.<anonymous> (C:\Users\btrah\node_modules\discord.js\src\client\websocket\WebSocketManager.js:235:12) at WebSocketManager.emit (C:\Users\btrah\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:287:31) at WebSocketShard.<anonymous> (C:\Users\btrah\node_modules\@discordjs\ws\dist\index.js:1190:51) at WebSocketShard.emit (C:\Users\btrah\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:287:31) at WebSocketShard.onMessage (C:\Users\btrah\node_modules\@discordjs\ws\dist\index.js:1007:14) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) Emitted 'error' event on Client instance at: at emitUnhandledRejectionOrErr (node:events:401:10) at process.processTicksAndRejections (node:internal/process/task_queues:92:21)
19 Replies
d.js toolkit
d.js toolkit7d ago
- 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!
d.js docs
d.js docs7d ago
- ReferenceError: "x" is not defined: learn more - TypeError: Cannot read properties of undefined/null (reading "x"): learn more
Skullfromroblox
SkullfromrobloxOP7d ago
Explain?
duck
duck7d ago
If you click the "learn more" link for your error, there's an explanation Though if you're really having trouble with variable definitions, I'd heavily suggest brushing up on the fundamentals before continuing
Skullfromroblox
SkullfromrobloxOP7d ago
Okay. Ill try Thank You
Samtino
Samtino7d ago
You could remove that sourcebin link ASAP. Your bot token is in it
duck
duck7d ago
and with that in mind you should reset your token
Samtino
Samtino7d ago
^
Skullfromroblox
SkullfromrobloxOP7d ago
Okay. Thank You guys.
duck
duck7d ago
(apparently I didn't scroll down far enough on mobile)
Skullfromroblox
SkullfromrobloxOP7d ago
And theres no “learn more”
duck
duck7d ago
No description
Skullfromroblox
SkullfromrobloxOP7d ago
Oh. Oops- Whats it mean “member”? I dont have anything “member” in my code.
Samtino
Samtino7d ago
Yes you do Line 16, inside of your guildMemberAdd
Skullfromroblox
SkullfromrobloxOP7d ago
Okay. Well how do i fix it?
Samtino
Samtino7d ago
By not using a variable that doesn't exist
duck
duck7d ago
again if you're having trouble with this, I would very heavily suggest brushing up on the fundamentals before continuing #resources
Skullfromroblox
SkullfromrobloxOP7d ago
Okay.

Did you find this page helpful?