#member object is undefined

1 messages · Page 1 of 1 (latest)

hexed anvil
#

Hi

rancid crescent
#

hi

hexed anvil
#

Can you share your current client intent part

#

@prime fossil here

rancid crescent
#

In the bot portal?

prime fossil
#

as in all intents or just the ones i mentioned before

hexed anvil
#

Nah in your code

prime fossil
#
const client = new Client({ intents: ['GUILDS', 'GUILD_MEMBERS', 'GUILD_MESSAGES', 'GUILD_VOICE_STATES'] });
hexed anvil
#

Add message too

rancid crescent
#

const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, ['GUILDS', 'GUILD_MEMBERS'] , ['GUILD_VOICE_STATES']] });

prime fossil
#

true

vestal comet
#

Thats not how an array works

hexed anvil
#

Ya

prime fossil
#

replace yours with that

rancid crescent
#

but i need the others-

#

but sure ig

#

k done

#

lemme try

rancid crescent
#

[Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES is not working anymore?

#

Still not working-

rancid crescent
prime fossil
#

show code

rancid crescent
#

module.exports = {
    name: 'messageCreate',

      execute(message) {

      if (message.channel.type === 'DM') return;
      if(message.member.permissions.has("ADMINISTRATOR")) return;```
hexed anvil
#

I saw his code and he is using files for event

prime fossil
#

ah

hexed anvil
#

@rancid crescent are you are loading file for event handling in client?

hexed anvil
#

I guess you are doing client, ..args

rancid crescent
#

mhm

hexed anvil
#
const discord = require('discord.js');

module.exports = {
    name: 'messageCreate',

      execute(client, message) {

      if (message.channel.type === 'DM') return;
      if(message.member.permissions.has("ADMINISTRATOR")) return;```
#

Try this

prime fossil
#

... oh bruh

#

yeah that'll do it aye

hexed anvil
rancid crescent
#

nope

vestal comet
#

It wont

prime fossil
#

was bouta ask where he's parsing in these values

rancid crescent
#

bot still warning me

hexed anvil
#

Umh

prime fossil
hexed anvil
#

Can you share code of main file where you are loading all the events

prime fossil
#

^

rancid crescent
#

the event handler right?

hexed anvil
#

Ya

rancid crescent
#

for (const file of eventFiles) {
 const event = require(`./events/${file}`);
 if (event.once) {
     client.once(event.name, (...args) => event.execute(...args, client));
 } else {
     client.on(event.name, (...args) => event.execute(...args, client));
 }
}```
vestal comet
#

@rancid crescent do you have GUILD_MESSAGES intent in the dev portal?

prime fossil
#

...args, client O_o

hexed anvil
#
member?** | 	partial guild member object | 	member properties for this message's author```
vestal comet
#

Not to get information about the message

vestal comet
rancid crescent
#

alr

vestal comet
#

*message

hexed anvil
#

Oh wait messages, i thought members

prime fossil
vestal comet
#

No

rancid crescent
vestal comet
#

Order doesnt matter, they had it correctly

vestal comet
rancid crescent
vestal comet
#

Did you log message?

rancid crescent
#

I think the bot ignoring the line.

rancid crescent
vestal comet
#

Code?

rancid crescent
#

module.exports = {
    name: 'messageCreate',

      execute(message) {

      if (message.channel.type === 'DM') return;
      if(message.member.permissions.has("ADMINISTRATOR")) return;
      console.log(message)
      ```
prime fossil
#

just send the lot (token removed)

hexed anvil
#

Umh log that after execute

rancid crescent
#

ok i have got something

rancid crescent
#

its too long to be send-

hexed anvil
vestal comet
#

Send it in a bin

prime fossil
rancid crescent
#
                          ^

TypeError: Cannot read properties of undefined (reading 'type')```
#

getting this now-

vestal comet
#

What did you change now?

rancid crescent
#
  channelId: '',
  guildId: '',
  id: '',
  createdTimestamp: ,
  type: 'DEFAULT',
  system: false,
  content: 'discord.gg/123',
  author: User {
    id: '',
    bot: false,
    system: false,
    flags: UserFlags { bitfield: 256 },
    username: '-',
    discriminator: '9037',
    avatar: 'c688fec350ce6a7a02518403071ef451',
    banner: undefined,
    accentColor: undefined
  },
  pinned: false,
  tts: false,```
vestal comet
rancid crescent
#

i did

hexed anvil
#

Why you are getting everything null

rancid crescent
#

module.exports = {
    name: 'messageCreate',

      execute(message) {
      console.log(message)

      if (message.channel.type === 'DM') return;
      if(message.member.permissions.has("ADMINISTRATOR")) return;```
prime fossil
#

Ok can someone please just address this, because I got this working fine in mine with the rest parameter as the last parameter, not the first

rancid crescent
hexed anvil
#

Nah you are not getting ids

vestal comet
rancid crescent
vestal comet
prime fossil
#

Thank you

rancid crescent
hexed anvil
#

He is not getting any ids

vestal comet
#

I already did

rancid crescent
#

im getting them

hexed anvil
prime fossil
#
const eventFiles = fs.readdirSync('./events').filter(file => file.endsWith('.js'));

for (const file of eventFiles) {
 const event = require(`./events/${file}`);
 if (event.once) {
     client.once(event.name, (...args) => event.execute(client, ...args));
 } else {
     client.on(event.name, (...args) => event.execute(client, ...args));
 }
}
rancid crescent
#

k lemme try

prime fossil
#

wait

#
const discord = require('discord.js');

module.exports = {
    name: 'messageCreate',

      execute(_client, message) {
      console.log(message)

      if (message.channel.type === 'DM') return;
      if(message.member.permissions.has("ADMINISTRATOR")) return;
rancid crescent
#

k

prime fossil
#

try those

rancid crescent
#

still nothing

prime fossil
#

wait wrong message

rancid crescent
#

for some reasons- im getting this error: ``` if (message.channel.type === 'dm') return;
^

TypeError: Cannot read properties of undefined (reading 'type')```

hexed anvil
prime fossil
hexed anvil
#

Log the message and copy and paste in this website

rancid crescent
vestal comet
prime fossil
#

it doesn't?

vestal comet
#

It does

hexed anvil
hexed anvil
prime fossil
#

veuillez m’excuser

vestal comet
#

@rancid crescent this is being short of caos.
1.- Did you change both files?
2.- Can you show the whole output of message in a pastebin?

hexed anvil
#

Umh

prime fossil
#

Ain't think like the 10th time we've attempted the pastebin route

rancid crescent
#

im fine

#

fixed

hexed anvil
#

I think he is hiding the details

rancid crescent
#

thank u all

hexed anvil
prime fossil
#

^^^

#

My man you can't leave us hanging that hard

hexed anvil
#

@rancid crescent ^^^

prime fossil
#

My menial brain requires knowledge that does not affect me in the slightest due to curiosity, but fed it must be

rancid crescent
#

uhm just changed something

hexed anvil
#

He is gone without telling us the solution

prime fossil
#

i bet he leaves his bins by the side of the road

rancid crescent
#

huh

#

just changed the perms(admin) to role perms

prime fossil
#

idk, you seem like the kinda guy to close the fridge with your hips. getting that vibe

prime fossil
#

just a hunch :)

rancid crescent
#

🤔

#

ok anyway ty

prime fossil
#

:D

hexed anvil
#

I can't delete this thread