Comments (3)
- 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
from discordgo.
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
from discordgo.
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.
from discordgo.
Related Issues (20)
- Anyway to get the "soft banned" gateway msg ?
- Where are the interfaces ? HOT 1
- How to make RateLimit work in multiple process?
- [Question] InteractionDeadline giving me timeouts in my commands response HOT 2
- `ChannelMessageSend` returns HTTP 405 error HOT 1
- Using closures as component callbacks
- How does discord get Midjourney alerts
- Sir, how can I get the data in the MessageEmbed structure?
- Threads disappear after updating the parent message
- Is it ok to use master branch in production env? `MessageSend.StickerIDs` seems missing in newest release(v0.27.1) HOT 4
- How can I be notified when the token is reset after I've connected to the Discord gateway?
- Discord robot gets warning messages HOT 3
- Discord-Bot can't see users message-content
- Discord Error 403 error code: 50001 Missing Access
- Error creating message components without emojis HOT 2
- DiscordGo: Encountering HTTP 400 Bad Request Error for Button Components Without Emojis HOT 1
- Invalid Form Body: BUTTON_COMPONENT_INVALID_EMOJI HOT 2
- Update v0.27.1 -> v0.27.2 HOT 2
- I use InteractionCreate with id only and nothing else
- Can't add SUPPRESS_EMBED flag to other user's message HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discordgo.