#AutoRole Giver
1 messages · Page 1 of 1 (latest)
or do you want to do it on join
no
you run this in a command, right?
then use ctx.guild.members
yes
same for the role, no need to get the guild, use ctx.guild
remove the bot.
you are using the ctx parameter from the function
ctx.guild.get_role(ViewerROLE_ID)
you dont have members intents
change that
enable the members intent on the developer portal and add it to your bot's intents in your code
no
intents = discord.Intents.default()
intents.members = True
and then ...intents=intents in the bot definition
Also consider not getting the same role for each member but putting it above the for member
Because it’s useless to get it for each member it’s still the same
Consider learning Python and OOP.