`fetchStarterMessage()` doesnt give me the first message of the thread

I am trying to get the first message associated with the thread. But the message object returned from the fetchStarterMessage is not giving me that. Below is the code I used to capture the thread creation.
module.exports = {
name: Events.ThreadCreate,
async execute(thread, newlyCreated) {
if (!newlyCreated) return;
if (!thread.isThread()) return;
thread.awaitMessages().then(v => console.log(v)); // not printing anything
var msg = await thread.fetchStarterMessage();
console.log("msg: ", msg); // the message object has the content, but it is the title of the thread
}
};
module.exports = {
name: Events.ThreadCreate,
async execute(thread, newlyCreated) {
if (!newlyCreated) return;
if (!thread.isThread()) return;
thread.awaitMessages().then(v => console.log(v)); // not printing anything
var msg = await thread.fetchStarterMessage();
console.log("msg: ", msg); // the message object has the content, but it is the title of the thread
}
};
Can you please help me get the first message of the thread?
2 Replies
d.js toolkit
d.js toolkit16mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
gimantha
gimanthaOP16mo ago
Thank you for the explanation. I will try out the awaitMessage() with the proper parameters. Do you think it should work? if it is not working I will tryout fetch of MessageManager Great! I will give it a try. Thanks a lot!
Want results from more Discord servers?
Add your server