Closed gncdev closed 1 year ago
That doesn't change anything. It just makes things very misleading. The ready object doesn't contain Guild objects, it just contains unavailable guilds with just the id to the guild.
That doesn't change anything
No, If you want to get all of the guilds, you need to send get request to "guilds/{guild.id}" every each of guild. But if you collect all guild in "onReady" event to map, you can easily create an access to all of the guilds.
Actually, discord.js, discord.py, discord.go always do process with readyData. They are get first all of the guilds from readyData then they are keep looking for "onGuildUpdate" event for update guild map. When come "onGuildUpdate" event, updates the map which collected the all of guild data.
But I can't found this feature in sleepydiscord
This doesn't change that, with this change, you still need to wait for guilds to be sent to the bot
This doesn't change that, with this change, you still need to wait for guilds to be sent to the bot
it doesn't. Ready data has all guild information. Actually ready data is result of merge Unavailable Guild and Guild
Look at the docs https://discord.com/developers/docs/topics/gateway-events#ready
Look at the docs https://discord.com/developers/docs/topics/gateway-events#ready
try my code.
void onReady(SleepyDiscord::Ready readyData) override {
for (SleepyDiscord::Server& server : readyData.servers) {
std::cout << server.ID.string() << "->" << server.vanityUrlCode << "\n";
}
}
the UnavailableGuild doesn't have "server.vanityUrlCode" but if you declare the readyData.servers to std::list\<Server> (not std::list\<UnavailableServer>), you can see working what i said.
I think they are forget to update docs :)
You should make an issue about it on the Discord docs or check someone already has
did you try?
No, because if this is true and intended, it should cause a ton of problems for big bots because ready would be a huge payload.
it is true. please try it, i beggin you :)
I'm asking you to make an issue about it on the docs to be sure if it's intended. Anything not on the docs might be unintentional.
Why do you think a huge amount of payload is coming in ready?
Just try my code.
I can't, I'm busy. Just make an issue to discord docs to check that this is intentional and will stay in the long term.
Okey, I will. But If you don't think like what I think, I can advise to you review discord.js or discord.py documentation.
on ready, discord gateway sends UnavailableGuild and Guild merge object for guild object. So we have access to Guild properties.