discord-net/Discord.Net

[Bug]: ForumTagBuilder builds ForumTagProperties instead of ForumTags

yort5 opened this issue · 2 comments

yort5 commented

Check The Docs

  • I double checked the docs and couldn't find any useful information.

Verify Issue Source

  • I verified the issue was caused by Discord.Net.

Check your intents

  • I double checked that I have the required intents.

Description

I am trying to programmatically create and attach a new tag when I'm creating a Forum post. The CreatePostAsync method optionally takes and array of FormTags, however there does not seem to be any way to create a ForumTag object. Searching through the docs and the code, most references are internal, and the method that seems like it would be the one to use - ForumTagBuilder - returns a ForumTagProperties object instead of a ForumTag. Shouldn't this provide us with a ForumTag? Or at least be renamed, but it would be nice to have some way to create a ForumTag.

Version

3.10.0

Working Version

No response

Logs

No logs, unless you want to see the exception when I try to cast a ForumTagProperties object to a ForumTag.

Sample

List<ForumTag> forumTags = new List<ForumTag>();
ForumTagBuilder builder = new ForumTagBuilder().WithName(rulesForumId);
// need to get to ForumTag
forumTags.Add(...);

forumChannel.CreatePostAsync(threadTitle, text: messageString, embed: channelEmbed.Build(), tags: forumTags.ToArray());

Packages

None

ForumTagBuilder is used only to create/modify tags in a forum channel
And since tags are predefined in a channel - it kinda makes sense that it not possible to just create ones.

So to get tags for the post - do some searching in IForumChannel.Tags collection

I agree with your point on naming, but changing it would be a breaking change, so it'd only be possible in v4.

yort5 commented

That makes sense. I was probably trying to use Tags for a little more than they are currently intended. I'll adjust my approach, and ignore the naming for now. :)