#closed
73 messages · Page 1 of 1 (latest)
You need to fetch the guild members before, using <Guild>.members.fetch()
really?
...yeah?
no, you need to fetch the guild members before; also you'll need to use await
2sec
yeah
the first line in the screenshot bruh
bro
the command is /giverole all
all is the subcommand
i put that there for a reason
First you need to fetch all members of the guild using <Guild>.members.fetch(), then use forEach to go through them (i'm not sure about forEach but I think it works). Be careful with your variables name, you're not getting users from this but members, which is not the same (member is in a guild, user is a discord account).
var members = await ctx.guild.members.fetch();
members.forEach(async member => {
console.log(member.displayName);
await member.roles.add(role);
...```
(await ctx.guild.members.fetch()).forEach(member => {
member.roles.add(role)
console.log(member.displayName)
})
listen to us if you’re a « bad coder »
error
oh yeah that's true
giving a role to everyone in a server is considered API spam
how else am I suppose to do that
= api spam
because you are doing a lot of requests to the API
@everyone exists
well that depends what's your goal here. You can do a reaction role, you can do it manually, you can edit @ everyone permissions...