post channel trough bot

Im able to create a thread using the bot on a text channel but for some reason i cant make one into a post channel (i want the bot to be able to make a post in a post channel)
24 Replies
d.js toolkit
d.js toolkit8mo 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!
HenkieThee
HenkieTheeOP8mo ago
So my question is bassicly, how do i make it so the bot can create posts in a post channel
d.js docs
d.js docs8mo ago
Documentation suggestion for @HenkieThee: :method: GuildForumThreadManager#create() Creates a new thread in the channel.
zeyad
zeyad8mo ago
this is for forum channels <ForumChannel>.threads.create()
HenkieThee
HenkieTheeOP8mo ago
Thanks, but what should be at the place of <ForumChannel> ? Like the channelid?
zeyad
zeyad8mo ago
no The channel
HenkieThee
HenkieTheeOP8mo ago
Name?
zeyad
zeyad8mo ago
This is just a placeholder to what u define the channel to be
HenkieThee
HenkieTheeOP8mo ago
Like that’s the problem i found that documantation you send but i can’t find a example
zeyad
zeyad8mo ago
It could be interaction.channel, it could a fetched channel in a variable called newChannel, it could be anything Lol there is literally an example right beneath the method
HenkieThee
HenkieTheeOP8mo ago
So if i fetch a channel by its id i can use the variable of that.threads.create
zeyad
zeyad8mo ago
Yep that works
HenkieThee
HenkieTheeOP8mo ago
Alright then i have to take another look because for some reason when fetching the channelid it can’t find the channel when getting the id of a forum channel but it works on normal text channels But thanks 🙂
zeyad
zeyad8mo ago
you might not be passing the correct channel ID in the fetch method 👍
HenkieThee
HenkieTheeOP8mo ago
Its the same way as getting the id from a normal text channel right?
zeyad
zeyad8mo ago
yes
HenkieThee
HenkieTheeOP8mo ago
Then that should not be the problem
zeyad
zeyad8mo ago
Try logging the channel you fetched and sending over some code
HenkieThee
HenkieTheeOP8mo ago
undefined on the forum channels (i made a new one just to be sure) but the other text channels below it gives back
<#833063342934982718>
<#833063342934982718>
for example.. this is how i do it
const test = client.channels.cache.get('1223756963540893867');
console.log(test);
const test = client.channels.cache.get('1223756963540893867');
console.log(test);
all the channels start with 8.... like 833063336203649053 or 833063336203649052 but the forum looks like this 1223756963540893867
d.js docs
d.js docs8mo ago
:method: GuildChannelManager#fetch() Obtains one or more guild channels from Discord, or the channel cache if they're already available.
zeyad
zeyad8mo ago
use this instead client.channels.fetch()
HenkieThee
HenkieTheeOP8mo ago
[object Promise]
[object Promise]
zeyad
zeyad8mo ago
first of it's a promise (so use await)
HenkieThee
HenkieTheeOP8mo ago
yea like this
const test = await client.channels.fetch('1223756963540893867');
console.log(test);
const test = await client.channels.fetch('1223756963540893867');
console.log(test);
null
null
its weird because evey channel i get a good response except for a forum channel like from voice channels, announcement channels, text channels but just not a forum channel any idea @zeyad_155? Else i will just make the posts by hand i guess
Want results from more Discord servers?
Add your server