#message.author.bot not working v13

1 messages · Page 1 of 1 (latest)

fickle tundra
#

Ok here my posts are getting buried so here in this thread

#

@scarlet sequoia

scarlet sequoia
#

log message near the start and see what it says

fickle tundra
#

ok

#

give me a sec

#

here is the log:

#
<ref *1> Message {
  channelId: '819566458111262730',
  guildId: '818065268999454721',
  deleted: true,
  id: '876562387304583178',
  system: null,
  type: null,
  content: null,
  author: null,
  pinned: null,
  tts: null,
  nonce: null,
  embeds: [],
  components: [],
  attachments: Collection(0) [Map] {},
  stickers: Collection(0) [Map] {},
  createdTimestamp: 1629059158875,
  editedTimestamp: null,
  reactions: ReactionManager { message: [Circular *1] },
  mentions: MessageMentions {
    everyone: false,
    users: Collection(0) [Map] {},
    roles: Collection(0) [Map] {},
    _members: null,
    _channels: null,
    crosspostedChannels: Collection(0) [Map] {},
    repliedUser: null
  },
  webhookId: null,
  groupActivityApplication: null,
  applicationId: null,
  activity: null,
  flags: MessageFlags { bitfield: 0 },
  reference: null,
  interaction: null
}
scarlet sequoia
#

the message is missing an author, no wonder your bot check crashes it

fickle tundra
#

Ik

#

where it go?

#

it worked in v12 so idk

scarlet sequoia
#

are you using partials?

fickle tundra
#

lemme check

scarlet sequoia
#

if you are, you need to fetch the message at the start

fickle tundra
#

ok here

#
const client = new Discord.Client({ intents: 24287, partials: ['MESSAGE', 'CHANNEL', 'REACTION', 'GUILD_MEMBER', 'USER'], ws: { properties: { $browser: "Discord iOS" }}});```
scarlet sequoia
#

yeah, either remove the message partials if you don't need it or fetch the message at the start

fickle tundra
#

wait

#

message.channel.type still has "dm" right?

#

Not the reason for the error but yea

scarlet sequoia
#

oh, didn't notice that

#

channeltypes are allcaps now

fickle tundra
#

so DM_TEXT?

scarlet sequoia
#

DM

fickle tundra
#

ok

#

its all null

#
  type: null,
  content: null,
  author: null,
  pinned: null,
  tts: null,
  nonce: null,
fickle tundra
ebon nimbus
#

It’s a partial message, fetching it isn’t possible in the delete event

fickle tundra
#

so how do i fix this?

ebon nimbus
#

You can’t

fickle tundra
#

why does it work in v12

ebon nimbus
#

Well, you can ignore partial messages

scarlet sequoia
#

oh, I really should focus more, didn't even notice that this is a delete event

ebon nimbus
#

He named the file messageDelete

#

I can see it bc I’m on my phone

fickle tundra
#

in my event handler

sturdy mulchBOT
#

<:_:874569322742308864> Message#partial
Whether or not this message is a partial

ebon nimbus
#

v12 should do the same thing

#

Still won’t fire without the partial tho

fickle tundra
ebon nimbus
#

Yea, and you can return or only use the channel and message id

fickle tundra
#

So message.partial is bascicly a replacement of message.author.bot

ebon nimbus
#

No

#

It checks if the message doesn’t have everything

#

When a message is deleted, Discord only gives the channel is and message id

#

d.js can only check the messages cache for it. If it’s not there, it’s gone forever

fickle tundra
#

how do i chache that

#

*cache

ebon nimbus
#

Keep ur bot online I guess

fickle tundra
#

it is online

ebon nimbus
#

Can also log messages as it’s sent in a db (as long as you abide to Discord TOS)

fickle tundra
#

docs outdated lol i guess

ebon nimbus
#

It doesn’t account for partials I guess

sturdy mulchBOT
scarlet sequoia
ebon nimbus
#

It caches messages as it’s received

#

Discord doesn’t send old messages on connect

fickle tundra
#

wait

scarlet sequoia
#

how taxing would it be to make the bot fetch old messages onReady?

ebon nimbus
#

taxing?

fickle tundra
#

i deleted a message after the bot starting then it errored

ebon nimbus
#

Did you return if the message is partial?

fickle tundra
#

i didn't understand

#

what makes a message partial?

ebon nimbus
#

It’s a message that comes with minimal data

fickle tundra
#

so like

#

deleted messages

scarlet sequoia
# ebon nimbus taxing?

as in how abusive it would be if I were to cycle through all channels of a single guild and and call channel.messages.fetch()?

ebon nimbus
#

Yes

fickle tundra
#

so i can only send the channel id and the message id

ebon nimbus
#

Ur guaranteed those properties

fickle tundra
#

ah ok

#

welp ima close the thread

ebon nimbus
#

Ok

fading brook
#

Hi