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 toolkit3mo 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
HenkieThee3mo 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 docs3mo ago
Documentation suggestion for @HenkieThee: :method: GuildForumThreadManager#create() Creates a new thread in the channel.
zeyad_155
zeyad_1553mo ago
this is for forum channels <ForumChannel>.threads.create()
HenkieThee
HenkieThee3mo ago
Thanks, but what should be at the place of <ForumChannel> ? Like the channelid?
zeyad_155
zeyad_1553mo ago
no The channel
HenkieThee
HenkieThee3mo ago
Name?
zeyad_155
zeyad_1553mo ago
This is just a placeholder to what u define the channel to be
HenkieThee
HenkieThee3mo ago
Like that’s the problem i found that documantation you send but i can’t find a example
zeyad_155
zeyad_1553mo 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
HenkieThee3mo ago
So if i fetch a channel by its id i can use the variable of that.threads.create
zeyad_155
zeyad_1553mo ago
Yep that works
HenkieThee
HenkieThee3mo 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_155
zeyad_1553mo ago
you might not be passing the correct channel ID in the fetch method 👍
HenkieThee
HenkieThee3mo ago
Its the same way as getting the id from a normal text channel right?
zeyad_155
zeyad_1553mo ago
yes
HenkieThee
HenkieThee3mo ago
Then that should not be the problem
zeyad_155
zeyad_1553mo ago
Try logging the channel you fetched and sending over some code
HenkieThee
HenkieThee3mo 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 docs3mo ago
:method: GuildChannelManager#fetch() Obtains one or more guild channels from Discord, or the channel cache if they're already available.
zeyad_155
zeyad_1553mo ago
use this instead client.channels.fetch()
HenkieThee
HenkieThee3mo ago
[object Promise]
[object Promise]
zeyad_155
zeyad_1553mo ago
first of it's a promise (so use await)
HenkieThee
HenkieThee3mo 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