This Library Is Not Handling Member Joins

I've a problem with my member join event handling, by which it only executes after the first member join, but it don't catches the joining of any member after the first one since the restart of the bot. Here's the code:
const { Events } = require('discord.js');
const client = require('../structure/instance.js');
const config = require('../structure/config.json');
const texts = require('../resources/texts.js')


module.exports = {
name: Events.GuildMemberAdd,
once: true,
async execute(member) {
console.log('Member joined.');

const guild = client.guilds.cache.get(config.guildId);
const role = guild.roles.cache.find((role) => role.id === texts.members);
await member.roles.add(role);

return;
},
};
const { Events } = require('discord.js');
const client = require('../structure/instance.js');
const config = require('../structure/config.json');
const texts = require('../resources/texts.js')


module.exports = {
name: Events.GuildMemberAdd,
once: true,
async execute(member) {
console.log('Member joined.');

const guild = client.guilds.cache.get(config.guildId);
const role = guild.roles.cache.find((role) => role.id === texts.members);
await member.roles.add(role);

return;
},
};
4 Replies
d.js toolkit
d.js toolkit16mo 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!
Pontifice
PontificeOP16mo ago
grass
grass16mo ago
you specify once: true what do you do with that
Pontifice
PontificeOP16mo ago
Thank you.
Want results from more Discord servers?
Add your server