can't receive event (no console message)

i am trying to receive a user joining but i don't seem to receive it, don't know why...
18 Replies
d.js toolkit
d.js toolkit13mo 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!
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
ZNomad
ZNomadOP13mo ago
yes and no it does not show the console message, but everything else is fine
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
ZNomad
ZNomadOP13mo ago
no errors yeah
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
ZNomad
ZNomadOP13mo ago
userjoin.js const { Client, GatewayIntentBits } = require('discord.js'); const client = new Client({ intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, ], }); client.on("guildMemberAdd", (member) => { console.log(member) })
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
ZNomad
ZNomadOP13mo ago
no, just that one file ohh
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
ZNomad
ZNomadOP13mo ago
i have an event handler in index.js (i think) const eventsPath = path.join(__dirname, 'events'); const eventFiles = fs.readdirSync(eventsPath).filter(file => file.endsWith('.js')); for (const file of eventFiles) { const filePath = path.join(eventsPath, file); const event = require(filePath); if (event.once) { client.once(event.name, (...args) => event.execute(...args)); } else { client.on(event.name, (...args) => event.execute(...args)); } }
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs13mo ago
guide Creating Your Bot: Event handling read more
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
ZNomad
ZNomadOP13mo ago
k looks fine to me
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
ZNomad
ZNomadOP13mo ago
that looks like that
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server