#How to create a post in a forum channel?

1 messages · Page 1 of 1 (latest)

lapis glen
#

I have the following code so far:

ITextChannel channel = ...; // Get the forum channel
await channel.CreateThreadAsync("The title of the thread", message: ???);

Where I'm stuck is that I don't know what to put for message. I assume this parameter is how I define the text of the first message and any tags that the post has. However, I'm not sure how to instantiate it or even what class it takes. According to https://sourcegraph.com/search?q=context:global+repo:https://github.com/discord-net/Discord.Net+class.*:.*\bIMessage\b&patternType=standard&sm=1&groupBy=repo, there are three abstract classes that implement IMessage: RestMessage, RpcMessage, and SocketMessage. Inheriting from SocketMessage is SocketUserMessage, which seemed promising, but it does not have any public constructor. Am I supposed to just create my own class?

Also going to point out that there's room for improvement in the documentation here, because it doesn't tell you how to do this at all.

#

How to create a post in a forum channel?

#

I'm now realizing that the message parameter might be applicable to threads made in text channels where you'd attach a thread to an existing message rather than a newly created message