#Cannot read property send of undefined when fetching a guild's members.

1 messages · Page 1 of 1 (latest)

flat anchor
#
[EVENT HANDLER] READY - TYPEERROR: CANNOT READ PROPERTY 'SEND' OF UNDEFINED
    AT C:\USERS\JOÃO TEIXEIRA\DOCUMENTS\WORKSHOP\PROJECTS\FREELANCING\BEERHUNTER\NODE_MODULES\DISCORD.JS\SRC\MANAGERS\GUILDMEMBERMANAGER.JS:422:24
    AT NEW PROMISE (<ANONYMOUS>)
    AT GUILDMEMBERMANAGER._FETCHMANY (C:\USERS\JOÃO TEIXEIRA\DOCUMENTS\WORKSHOP\PROJECTS\FREELANCING\BEERHUNTER\NODE_MODULES\DISCORD.JS\SRC\MANAGERS\GUILDMEMBERMANAGER.JS:419:12)
    AT GUILDMEMBERMANAGER.FETCH (C:\USERS\JOÃO TEIXEIRA\DOCUMENTS\WORKSHOP\PROJECTS\FREELANCING\BEERHUNTER\NODE_MODULES\DISCORD.JS\SRC\MANAGERS\GUILDMEMBERMANAGER.JS:177:31)   
    AT FUNCTION.FETCHMEMBERS (C:\USERS\JOÃO TEIXEIRA\DOCUMENTS\WORKSHOP\PROJECTS\FREELANCING\BEERHUNTER\DIST\EVENTS\READY.JS:16:58)
    AT PROCESSTICKSANDREJECTIONS (NODE:INTERNAL/PROCESS/TASK_QUEUES:96:5)
    AT ASYNC CLIENT.MAIN (C:\USERS\JOÃO TEIXEIRA\DOCUMENTS\WORKSHOP\PROJECTS\FREELANCING\BEERHUNTER\DIST\EVENTS\READY.JS:41:13)
pearl hazel
#

could you show ready line 16-41?

#

ready.js

#

@flat anchor

pulsar spoke
#

do u have GUILDS intent?

pearl hazel
#

oh, yeah, that may couse this error

pulsar spoke
#

just looked through djs code and it relies on this.guild, which relies on cache

flat anchor
#

I do have it yes

#
    private readonly _client: Client = new Client({
        intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_VOICE_STATES, Intents.FLAGS.GUILD_MEMBERS],
    });
pearl hazel
#

could you show ready.js 16-41

pulsar spoke
#

then for some reason. GuildMemberManager loses it's this.guild

flat anchor
#

It's transpiled from TypeScript code so its kinda messy

pulsar spoke
#

as that is undefined. What djs version are u on? also log <Client>.options.intents

pearl hazel
#

could you log this.guild and see if it is a Guild object?

pulsar spoke
#

u cannot log this.guild, it is in guild membermanager.. U have to do that in that class.

flat anchor
#

Okay let me try

pulsar spoke
#

what u can do is log the manager <Guild>.members, and show us the log

pearl hazel
#

just check if it returns undefined

flat anchor
#

Scroll down there's the GuildMemberManager

pulsar spoke
#

wth, weird. It seems like ur shardId is undefined, idk what can cause this lol

flat anchor