Coder Social home page Coder Social logo

Comments (12)

HopeBaron avatar HopeBaron commented on July 22, 2024 1

You can view #55 for updates on the matters. Your question has sparked a discussion
And it seems better in your case to just use the GUILD_PRESENCE intent
which will provide us with the members in GuildCreateEvent, which in turn will allow us to cache them

If you are using Gateway Intents, members and presences returned in this event will only contain your bot and users in voice channels unless you specify the GUILD_PRESENCES intent.

look more into it here: https://discord.com/developers/docs/topics/gateway#guilds

from kord.

HopeBaron avatar HopeBaron commented on July 22, 2024

Hello, What Kord version are you on?

from kord.

nlwillia avatar nlwillia commented on July 22, 2024

Sorry, 0.6.10

from kord.

HopeBaron avatar HopeBaron commented on July 22, 2024

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.
This is the PR updating the readme for 0.7.x
#159

from kord.

nlwillia avatar nlwillia commented on July 22, 2024

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...guild.members always only sees the bot user instead of the full list, so it's more consistent but still suggests something unplanned happening w/the cache.

from kord.

DRSchlaubi avatar DRSchlaubi commented on July 22, 2024

I couldn't get Gradle to resolve it before...looks like I didn't know about the extra repo.

you need to add the Sonatype repo: maven("https://oss.sonatype.org/content/repositories/snapshots")
then you can add the snapshot implementation("dev.kord:kord-core:0.7.0-SNAPSHOT")

from kord.

DRSchlaubi avatar DRSchlaubi commented on July 22, 2024

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

from kord.

HopeBaron avatar HopeBaron commented on July 22, 2024

Hey, I'll look into it when possible, right now my Gradle isn't acting fine.
Will inform you of any updates. However if you'd like you can join our Discord server.

from kord.

DRSchlaubi avatar DRSchlaubi commented on July 22, 2024

This works as a workaround:

kord.on<ReadyEvent> {
        for (guildId in guildIds) {
            gateway.requestGuildMembers(guildId).launchIn(kord)
        }
    }

from kord.

HopeBaron avatar HopeBaron commented on July 22, 2024

Hello there, sorry for late replying but I have issues with my network here.
The issue here is that the cache is not yet filled with members.
in order to do this you call

gateway.requestGuildMembers(guildId) 

in your ReadyEvent.
this sends member chunks that we will cache for you
in order for the requests to be sent, you need to collect the result flows.

Now that you have the members of the guild you care about cached. you can list them in other events.

TL;DR:
if you want to have members of all guilds add this to your ReadyEvent

     for (guildId in guildIds) {
                gateway.requestGuildMembers(guildId).launchIn(kord)
            }

in-order to request and cache members through gateway.

from kord.

nlwillia avatar nlwillia commented on July 22, 2024

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.

from kord.

HopeBaron avatar HopeBaron commented on July 22, 2024

The issue has been closed due to inactivity, feel free to open it again if you face further problems.

from kord.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.