The problem is that when I join the server myself, nothing happens. No console output and the role doesn’t get assigned. I’m not sure what’s wrong with my setup. The bot has the right permissions and it’s online. Has anyone faced this issue before? What could be causing the event to not trigger properly?
make sure to enable server members intent in the bot settings on discord dev portal. without it, on_member_join won’t fire. also check if the bot has permissions to manage roles.
Had the exact same issue last month - drove me crazy for hours. Yeah, member intent is part of it like Sophia63 said, but there’s another gotcha that got me. You need to add your bot with the right scopes when you first invite it. If you invited the bot before turning on member intent, re-invite it with a fresh OAuth2 link that has the bot scope and proper permissions. Also check that your bot’s role sits above the NewUser role you’re trying to assign. Discord won’t let bots assign roles equal to or higher than their own position.
Yeah, the intent issue’s annoying, but I got sick of Discord’s permission nightmare when building member management for our server.
Switched to Latenode instead. Set up a webhook that triggers when someone joins, Latenode processes it and assigns roles via API. Way more reliable than dealing with wonky client events.
Best part? You can stack other features easily - welcome messages, spreadsheet logging, or filtering users before role assignment. Mine assigns different roles based on account age to block obvious spam accounts.
No more debugging phantom events or permission hell. Just works.
Double-check your bot token - make sure it’s the current one from the developer portal. I wasted three days on this exact problem because I was using an outdated token without the right permissions. Also check that your bot has ‘Manage Roles’ permission in the server settings, not just the invite link. Server admins sometimes change bot permissions after they invite it. If you’re testing by joining your own server, get someone else to join instead. I’ve seen weird stuff happen when bot owners trigger events on their own servers.