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
- 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!So my question is bassicly, how do i make it so the bot can create posts in a post channel
Documentation suggestion for @HenkieThee:
:method: GuildForumThreadManager#create()
Creates a new thread in the channel.
this is for forum channels
<ForumChannel>.threads.create()
Thanks, but what should be at the place of <ForumChannel> ?
Like the channelid?
no
The channel
Name?
This is just a placeholder to what u define the channel to be
Like that’s the problem i found that documantation you send but i can’t find a example
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 methodSo if i fetch a channel by its id i can use the variable of that.threads.create
Yep
that works
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 🙂
you might not be passing the correct channel ID in the fetch method
👍
Its the same way as getting the id from a normal text channel right?
yes
Then that should not be the problem
Try logging the channel you fetched
and sending over some code
undefined on the forum channels (i made a new one just to be sure) but the other text channels below it gives back
for example..
this is how i do it
all the channels start with 8.... like 833063336203649053 or 833063336203649052 but the forum looks like this 1223756963540893867
:method: GuildChannelManager#fetch()
Obtains one or more guild channels from Discord, or the channel cache if they're already available.
use this instead
client.channels.fetch()
first of it's a promise (so use await)
yea like this
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