-
Notifications
You must be signed in to change notification settings - Fork 81
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
Cache conflict when using Guilds and GuildMembers intents together #167
Comments
Hello, What Kord version are you on? |
Sorry, 0.6.10 |
could you try using the snapshot on 0.7.x branch? There is a group id change as well so please read the readme there. |
I couldn't get Gradle to resolve it before...looks like I didn't know about the extra repo. With 0.7.x it doesn't matter how I configure the intents... |
you need to add the Sonatype repo: |
Tried this val kord = Kord(System.getenv("token")) {
intents += Intents(Intent.Guilds, Intent.GuildMembers)
} message.channel.createMessage(message.getGuild().members.toList().joinToString(" ") { it.displayName }) on the snapshot still only get the bot member |
Hey, I'll look into it when possible, right now my Gradle isn't acting fine. |
This works as a workaround: kord.on<ReadyEvent> {
for (guildId in guildIds) {
gateway.requestGuildMembers(guildId).launchIn(kord)
}
} |
Hello there, sorry for late replying but I have issues with my network here. gateway.requestGuildMembers(guildId) in your Now that you have the members of the guild you care about cached. you can list them in other events. TL;DR: for (guildId in guildIds) {
gateway.requestGuildMembers(guildId).launchIn(kord)
} in-order to request and cache members through gateway. |
Okay. It sounds like this has evolved and there's a different approach now vs. the inconsistent and possibly unintended behavior in 0.6. I didn't start with 0.7 because it wasn't obvious from the front page how to setup the dependency, but I'll proceed with that and see how it goes. Member scanning is something I should probably handle differently anyway, but the weirdness with the intent config caught my attention and seemed like something that should be understood. Thanks for the attention. |
You can view #55 for updates on the matters. Your question has sparked a discussion
look more into it here: https://discord.com/developers/docs/topics/gateway#guilds |
The issue has been closed due to inactivity, feel free to open it again if you face further problems. |
I've attached a project that just connects and prints the member list from the ready event.
On the discord end, I've turned on the GUILD_MEMBERS flag.
I'm finding that if I configure Kord with just
+Intent.GuildMember
then I get all the members back fromguild.members
against my test server. But if I add+Intent.Guild
it only returns the bot's own user.It's weird to turn on an intent and get less data. The difference seems to be that
Guild
is causing the cache to be initialized prematurely. I'm wondering if that's supposed to happen or how I should work around it. This is kind of a one-off; I don't necessarily want the whole member list in cache, but if I ask for it, it's surprising if I don't get it. I guess I can useRestEntitySupplier
directly...The text was updated successfully, but these errors were encountered: