fetchStarterMessage on threadCreate doesn't work

I'm trying to fetch the first message when a thread (in a forum) is created. But it doesn't work. How can i Do ?
const { Events, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
const { getProjectCategories } = require('../managers/projectCategories');


module.exports = {
name: Events.ThreadCreate,
async execute(ThreadChannel) {
turn
}

setTimeout(async () => {
const Message = await ThreadChannel.fetchStarterMessage();
console.log(Message.content)
},5000)

ThreadChannel.fetchStarterMessage().then(Message => {
console.log(Message.content)
})
};
const { Events, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
const { getProjectCategories } = require('../managers/projectCategories');


module.exports = {
name: Events.ThreadCreate,
async execute(ThreadChannel) {
turn
}

setTimeout(async () => {
const Message = await ThreadChannel.fetchStarterMessage();
console.log(Message.content)
},5000)

ThreadChannel.fetchStarterMessage().then(Message => {
console.log(Message.content)
})
};
7 Replies
d.js toolkit
d.js toolkitā€¢2y ago
ā€¢ What's your exact discord.js npm list discord.js and node node -v version? ā€¢ Post the full error stack trace, not just the top part! ā€¢ Show your code! ā€¢ Explain what exactly your issue is. ā€¢ Not a discord.js issue? Check out #useful-servers.
treble/luna
treble/lunaā€¢2y ago
do you have the messageContent intent
treble/luna
treble/lunaā€¢2y ago
thats not my question but sounds like you dont
! GhostvOne.tv šŸ‘»šŸ‡«šŸ‡·
You mean messageContent permission ?
! GhostvOne.tv šŸ‘»šŸ‡«šŸ‡·
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
! GhostvOne.tv šŸ‘»šŸ‡«šŸ‡·
let me check Thanks for your help. it works with messageContent intent now
Want results from more Discord servers?
Add your server