#closed

73 messages · Page 1 of 1 (latest)

ember estuaryBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

simple wedge
#

You need to fetch the guild members before, using <Guild>.members.fetch()

hollow heart
simple wedge
#

...yeah?

hollow heart
#

so

#

like this?

simple wedge
#

no, you need to fetch the guild members before; also you'll need to use await

hollow heart
#

wdym await

#

await fetch?

simple wedge
#

2sec

hollow heart
#

like this?

#

lmao im sorry im a bad coder

warped ore
#

the first line is useless

#

and remove const member

hollow heart
#

oh yeah

#

i forgot

#

alr so now what

warped ore
#

wdym « now what »?

#

I told you changes

hollow heart
#

you tell me

#

yeah

#

is that it?

warped ore
#

yeah

hollow heart
#

i dont think thats gonna work

#

so like this

#

which first line

warped ore
#

the first line in the screenshot bruh

hollow heart
#

bro

#

the command is /giverole all

#

all is the subcommand

#

i put that there for a reason

simple wedge
#

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);
  ...```
warped ore
hollow heart
#

if this works

#

i swear

warped ore
hollow heart
#

aww

#

didnt work

warped ore
#

error

hollow heart
#

no error

#

it just didnt give the role

#

to anyone

#

hold up let me try something

warped ore
#

also

#

it’s API spam

#

don’t do that

#

@everyone exists for a reason

simple wedge
#

oh yeah that's true

hollow heart
#

wdym

#

its suppose to give everyone a role

simple wedge
#

giving a role to everyone in a server is considered API spam

hollow heart
#

how else am I suppose to do that

warped ore
simple wedge
#

because you are doing a lot of requests to the API

warped ore
hollow heart
#

what is @everyone gonna do

#

we have a custom role

simple wedge
hollow heart
#

well

#

i created the bot before the members joined

#

and not all of them have the right role

#

so

#

yeah

#

and i just want to automate the process

LOOK AT THE MESSAGES
IT SAYS 69 LMAO

#

closed

#

!close

#

?close

#

idk