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 toolkit10mo 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
Pontifice10mo ago
discord.js@14.12.1 v20.3.0
grass
grass10mo ago
you specify once: true what do you do with that
Pontifice
Pontifice10mo ago
Thank you.