-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Description
Which package is this bug report for?
discord.js
Issue description
During the MessageDelete event message.author is for what ever reason coming back undefined and it makes no sense why a message would have no author for some, but other deleted messages still have it. It seems to be related to when the bot starts and when the message is originally sent.
Steps to reproduce:
- Send a message
- Start the bot
- Delete the message
- Code inside the MessageDelete event logs to the console the message object.author
- Results in undefined
I see no reason why this should be happening with messages sent prior to the bot being started.
Code sample
const { TOKEN, APP_ID } = process.env
const { Client, Events, GatewayIntentBits, Partials } = require( 'discord.js' )
const client = new Client({
intents: [ GatewayIntentBits.Guilds,GatewayIntentBits.GuildBans,GatewayIntentBits.GuildMessages,GatewayIntentBits.GuildMessageReactions,GatewayIntentBits.MessageContent ],
partials: [ Partials.User,Partials.Channel,Partials.Reaction,Partials.Message,Partials.GuildMember ]
})
client.on( Events.MessageDelete, async ( message ) => {
console.log( message )
console.log( message.author )
} )
client.login( TOKEN )
Versions
Version of discord.js: discord.js@14.14.1
Issue priority
Low (slightly annoying)
Which partials do you have configured?
User, Channel, GuildMember, Message, Reaction
Which gateway intents are you subscribing to?
Guilds, GuildMessages, GuildMessageReactions, MessageContent
I have tested this issue on a development release
No response
Reactions are currently unavailable