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

Add support for ws event GUILD_MEMBERS_CHUNK #25

Closed
bwmarrin opened this issue Dec 17, 2015 · 3 comments
Closed

Add support for ws event GUILD_MEMBERS_CHUNK #25

bwmarrin opened this issue Dec 17, 2015 · 3 comments
Milestone

Comments

@bwmarrin
Copy link
Owner

No description provided.

@bwmarrin
Copy link
Owner Author

  • what the hell is GUILD_MEMBERS_CHUNK
  • if you have large_threshold enabled, you can send an opcode to request all the users that were withheld from you
  • if you own a server with > 100 members, and you open the members settings page, you can see it when the # of members jumps up
    GUILD_MEMBERS_CHUNK is a bit more interesting than that
    4:09 PMVoltanayeah I noticed there was a query and limit field to that opcode
    4:09 PMVoltanabut I didnt see the client using them
    4:09 PMReactit does
    4:10 PMReactin the DM window
    4:10 PMReactwhen u hit the +
    4:10 PMReactthat's how it grabs the full list of users
    4:10 PMReactand queries it
    4:10 PMVoltanabut if you already downloaded all users, why query?
    4:10 PMReacti think optimization should be done
    4:10 PMReactbut its not right now lol
    4:10 PMVoltanalol
    4:10 PMDannyhow does MEMBERS_CHUNK work anyway
    4:10 PMReactu send opcode 8
    4:10 PMDannydo you request it
    4:11 PMReactand u get back a members chunk
    4:11 PMDannyah okay
    4:11 PMReactand u update ur member list

@bwmarrin bwmarrin added this to the v0.8.0 milestone Dec 23, 2015
@bwmarrin bwmarrin modified the milestones: v0.10.0, v0.8.0 Jan 6, 2016
@bwmarrin bwmarrin modified the milestones: v0.10.0, v1.0.0 Jan 27, 2016
@bwmarrin
Copy link
Owner Author

More info

Danny - Today at 10:31 PM
so what you have to do is request for chunking (i.e. send to the websocket)
for the servers you want to get the offline members for
the servers that require chunking have a boolean property called large on ready
the chunking format is
{
    'op': 8,
    'd': {
        'guild_id': [ guild id list of servers],
        'query': '',
        'limit': 0
    }
}
you send this to the websocket
afterwards you will get GUILD_MEMBERS_CHUNK events (receive)
that are paginated at 1000 members per chunk
you can know when to stop with a new property
member_count in the guild
e.g. a member_count of 2531 means that you'll get 3 GUILD_MEMBERS_CHUNK
1000, 1000, and 531
note that these chunks also include online members

@bwmarrin
Copy link
Owner Author

Danny - Today at 10:36 PM
you will also require chunking for joining guilds @Skippy
in GUILD_CREATE
if large == true

So when you join a guild and it returns the guild info event, if it's large enough, offline members will not be included and we'll need to use the chunking op to fetch them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants