Thread sometimes null?

Why is thread sometimes null?
msg = await (channel as ForumChannel).threads.create({name: post.info.title,message: {embeds: [embed], components: [actionRow]}, appliedTags: tags});
(channel as ForumChannel).threads.fetch(msg.id).then(async (thread) => {thread?.send({components: [bumpBtnRow]}); updateMessage(post.id, {id: thread?.id || '', url: thread?.url || ''}); updateApproval(post.id)})
msg = await (channel as ForumChannel).threads.create({name: post.info.title,message: {embeds: [embed], components: [actionRow]}, appliedTags: tags});
(channel as ForumChannel).threads.fetch(msg.id).then(async (thread) => {thread?.send({components: [bumpBtnRow]}); updateMessage(post.id, {id: thread?.id || '', url: thread?.url || ''}); updateApproval(post.id)})
7 Replies
d.js toolkit
d.js toolkit10mo 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!
Ateeb Sohail
Ateeb SohailOP10mo ago
For instance I created these two posts side by side
No description
Ateeb Sohail
Ateeb SohailOP10mo ago
(N/A is the default value) It seems to be the first one after bot starts even though thread gets created and msg is sent and everything its the same here
msg = (channel as TextChannel).send({content: ping, embeds: [embed], components: [actionRow]}).then(async (msg) => {
updateMessage(post.id, {id: msg.id, url: msg.url})
updateApproval(post.id)
console.log(msg.id, msg.url)
})
msg = (channel as TextChannel).send({content: ping, embeds: [embed], components: [actionRow]}).then(async (msg) => {
updateMessage(post.id, {id: msg.id, url: msg.url})
updateApproval(post.id)
console.log(msg.id, msg.url)
})
well i just console.logged thread. its not null still it says N/A
Ateeb Sohail
Ateeb SohailOP10mo ago
Pastebin
export async function sendPost(post: Post) { let channel: discor...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Bloonatics
Bloonatics10mo ago
add await to .updateOne()
d.js docs
d.js docs10mo ago
:method: GuildForumThreadManager#create() Creates a new thread in the channel.
Bloonatics
Bloonatics10mo ago
it returns Promise<ThreadChannel>, just use it instead of fetching again
Want results from more Discord servers?
Add your server