#message.author.bot not working v13
1 messages · Page 1 of 1 (latest)
log message near the start and see what it says
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
}
the message is missing an author, no wonder your bot check crashes it
are you using partials?
lemme check
if you are, you need to fetch the message at the start
ok here
const client = new Discord.Client({ intents: 24287, partials: ['MESSAGE', 'CHANNEL', 'REACTION', 'GUILD_MEMBER', 'USER'], ws: { properties: { $browser: "Discord iOS" }}});```
yeah, either remove the message partials if you don't need it or fetch the message at the start
wait
message.channel.type still has "dm" right?
Not the reason for the error but yea
oh, didn't notice that
channeltypes are allcaps now
so DM_TEXT?
DM
ok
its all null
type: null,
content: null,
author: null,
pinned: null,
tts: null,
nonce: null,
how do i do that?
It’s a partial message, fetching it isn’t possible in the delete event
so how do i fix this?
You can’t
why does it work in v12
Well, you can ignore partial messages
oh, I really should focus more, didn't even notice that this is a delete event
in my event handler
<:_:874569322742308864> Message#partial
Whether or not this message is a partial
so message.partial?
Yea, and you can return or only use the channel and message id
So message.partial is bascicly a replacement of message.author.bot
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
Keep ur bot online I guess
it is online
Can also log messages as it’s sent in a db (as long as you abide to Discord TOS)
docs outdated lol i guess
It doesn’t account for partials I guess
<:_:862626783890636830> discordjs.guide results:
• Popular Topics: Partial Structures
• Popular Topics: Enabling Partials
• Popular Topics: Handling Partial data
about this, does d.js get old messages into cache by itself or does it just get what ever is sent when it is online?
wait
how taxing would it be to make the bot fetch old messages onReady?
taxing?
i deleted a message after the bot starting then it errored
Did you return if the message is partial?
It’s a message that comes with minimal data
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()?
Yes
Very
so i can only send the channel id and the message id
Ur guaranteed those properties
Ok
Hi