#Question regarding forums

1 messages · Page 1 of 1 (latest)

mild mason
#

Is it possible to fetch all posts of a forums channel?

#

Ex
/fetch #1019643879257026742
bot returns
there are 100 posts under the help channel

#

Also, is it possible to fetch reaction count of each post? thonk

fast ingot
# mild mason Is it possible to fetch all posts of a forums channel?

Yes, it's possible, you have to check each channel in the guild if it is SocketThreadChannel type, then check the SocketThreadChannel.ParentChannel property if it matches to the forum channel that you want to get all the posts or threads. Now, to get the reactions of a thread, you just need to use the SocketThreadChannel.GetMessageAsync method and pass the thread ID. The thread ID is basically the first message of a thread channel, then you would be able to get the reactions by using the IMessage.Reactions property. I could provide you an example of code if you want, I would like you to figure it out by yourself, but if you can't, just mention me, and then I will provide you an example.

mild mason
#

Thank you, will try it

stark crest
#

You can use the built in method in SocketForumChannel to get active threads. There are methods to get archived ones as well

fast ingot
#

Yeah, it does.

#

I think it's fine to use that method, since the limit is 1k and Discord.NET handles the ratelimits after all.

fast ingot
#

But it's still a good idea to use the cache, instead of requesting data, because the limit may change in the future.