#Let's talk

1 messages · Page 1 of 1 (latest)

fickle thicket
#

@shy shore hi

#

How are you defining author?

last leaf
#

there's no need to open a thread, you could have helped him in the channel lol

fickle thicket
#

meh, I also have a question myself

#

I wanted to try cleaning up a bit

#

My apologies if I wasn't supposed to

jaunty iris
#

@last leaf you have a life? i see you on here everytime i come check poggies (this not meant to be offensive or anything lol)

#

i just think its damn funny

fickle thicket
#

currently waiting on James

fickle thicket
#

my suspicion is he's defining a nonexistent variable

#

like, msg.author or something

last leaf
last leaf
fickle thicket
last leaf
#

ah

jaunty iris
fickle thicket
#

but, it's always nice to have a 2nd opinion sometimes lool

jaunty iris
#

there are thousands people per day posting cannot read property of undefined

jaunty iris
last leaf
#

@jaunty iris got a question

jaunty iris
#

sure

fickle thicket
#

I like how we've turned this chat into our own

fickle thicket
last leaf
#
  message.guild.members.fetch().then(members => {
    let onlineMembers = members.filter(member => member.presence.status === 'online');
    console.log(onlineMembers);
  });
```any idea why this returns TypeError: Cannot read properties of null (reading 'status')
fickle thicket
#

try presence?.status

fickle thicket
#

if they're offline they have no status

#

otherwise, it should work

last leaf
#

yea, but there are online users on the server, its returning Collection(0) [Map] {}

fickle thicket
#

member.presence?.status

last leaf
#

yea did that

fickle thicket
#

that's your trump card in this situation

#

hm..

last leaf
#

cuz afaik members is a collection of guildmembers

fickle thicket
#

very dumb question

#

but are you sure you enabled special intents

#

and enabled them in your index.js?

last leaf
#

lets see

#

well i'd say i did

#

but that would be a lie

#

thanks, will try it now

#

yea works fine, thanks mate

jaunty iris
#

hahaha