[✅]lastMessage is null when lastMessageId is not ? [DM channel]

Hello ! As explained in this title, I'm using dmChannel in a command, just that atm :
const dmChannel = await user.createDM();

console.log(await dmChannel.lastMessageId);
console.log(await dmChannel.lastMessage);
//await dmChannel.send(args.join(" "));
await message.react('✅');
const dmChannel = await user.createDM();

console.log(await dmChannel.lastMessageId);
console.log(await dmChannel.lastMessage);
//await dmChannel.send(args.join(" "));
await message.react('✅');
Here is the output
1056613381500584057
null
1056613381500584057
null
I only have GatewayIntentBits.DirectMessages as DM related intent atm. Am I missing something ? node version : 16.15.0
8 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Akihiro
Akihiro2y ago
additional information : The DM channel between me and the bot contains only two message from him
Parogo_72
Parogo_722y ago
that can be expected just because the id is present doesnt mean that the bot will fetch it/have the message in cache
Akihiro
Akihiro2y ago
So I have to get around this by fetching the message with the ID I guess ? <:AlbedoMath_Wilock:799116606168629248>
Parogo_72
Parogo_722y ago
channel.messages.fetch(id)
Akihiro
Akihiro2y ago
Yeah, alright Thank you ~ <:KleeOK_GreenTea:782407596778061835>
Parogo_72
Parogo_722y ago
when fetching a channel from discord, it only sends the id discord.js doesnt fetch the message associated
Akihiro
Akihiro2y ago
Yeah I forgot about this cached concept sorry DeadPaimon again !