How do I make my bot "greet" a new member?
So I have this projeect structure.
The code of
guildAddMember.js
file:
index.js
file:
For some reason, when I join with my alt, the bot does not react with any message. I need help finding out why, thanks!10 Replies
Check your intents. I think you need something along the lines of Guild member intent.
It should give you an autocompletable list because it's an enum
Also does that ping command work? If yes that rules out folder config problems
Nope, all the intents are enabled.
On discord developer portal all 3 privileged intents are on, but now I'm not sure about the ones I use in my index file. I can't check them out now though.
Also yes, it does work.
Do you define
this.container.guild
somewhere? Because that's normally invalid. In fact, newcomer
can be replaced by the member
from the parameters.
FYI if you use TypeScript instead of JavaScript a thing like this would be alerted to you.
Also if that is indeed the case you would also see this through the logs.Oh, I didn't define
this.comtainer.guild
. but I will try this and let you know if this helps.
About the logs, nothing was in the console besides the slash application command registry and my another listener's notification that the bot is ready
Oops, didnt mean to ping you, forgot to uncheck the tag thing.uhm
oh I dont think we have a default impl for
listenerError
eventSo does it mean that the listener error will not be logged?
not by default no. You can add your own listener with the event listenerError to listen for errors from other listeners
Will do as well.
I think these are the only possible ways to solve the problem so far?
The way javascript (or any programming language for that matter) works is if an errors is thrown for a line then anything below that line no longer gets executed
and an error will be thrown where I pointed it out
specifically
Uncaught TypeError: Cannot read property of undefined (reading 'member')
Thanks.
Ill get to it in the morning