Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on_guild_join does not get a list of all server members #5951

Closed
stwxdev opened this issue Oct 19, 2020 · 11 comments
Closed

on_guild_join does not get a list of all server members #5951

stwxdev opened this issue Oct 19, 2020 · 11 comments
Labels
bug This is a bug with the library.

Comments

@stwxdev
Copy link

stwxdev commented Oct 19, 2020

Hi, after the update, I just can't get a list of all server members when the bot connects to it

import discord
intents = discord.Intents.default()
intents.members = True
intents.guilds = True

Here is the event itself

@bot.event
async def on_guild_join(guild):
    for member in guild.members:
        print('-------------------')
        print (member.id)

For some reason, it only displays the bot itself
And I don't know what to do, it's either a bug, or I'm crooked

@stwxdev stwxdev added the bug This is a bug with the library. label Oct 19, 2020
@averwhy
Copy link

averwhy commented Oct 19, 2020

have you set your intents on the developer portal?

@stwxdev
Copy link
Author

stwxdev commented Oct 19, 2020

image
Yes

@averwhy
Copy link

averwhy commented Oct 19, 2020

show your bot constructor

@stwxdev
Copy link
Author

stwxdev commented Oct 19, 2020

bot constructor? I don't quite understand

@scrazzz
Copy link
Contributor

scrazzz commented Oct 19, 2020

This is your bot constructor 👇🏼
bot = commands.Bot(command_prefix='!', intents=intents)

This is not the place to ask for #help btw. Join the discord.py server - https://discord.gg/dpy

@stwxdev
Copy link
Author

stwxdev commented Oct 19, 2020

image

@averwhy
Copy link

averwhy commented Oct 19, 2020

join https://discord.gg/dpy and close this

@stwxdev
Copy link
Author

stwxdev commented Oct 19, 2020

image
Ок :(

@stwxdev stwxdev closed this as completed Oct 19, 2020
@raven0034
Copy link

you need to use intents.presences else it won't work

@stwxdev
Copy link
Author

stwxdev commented Oct 19, 2020

Now it only displays one random participant

@SebbyLaw
Copy link
Contributor

SebbyLaw commented Oct 19, 2020

Duplicate of #5867

This is not an issue with discord.py. GitHub issues for this repository should be used to report issues with this library.

For further help specific to using this library, you should join either the official discord.py server or the Discord API server, as the README recommends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug with the library.
Projects
None yet
Development

No branches or pull requests

5 participants