You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Reproduction:
Steps:
Create a forum (#testforum) channel with at least one tag.
CheckRequire people to select tags when posting in #testforum.
Create ForumTag[] tags containing one valid ForumTag from #testforum.
Use CreatePostWithFileAsync(title, stream, fileName, archiveDuration, text, embed, tags) to create a post in #testforum.
Expected Result:
A post is made in #testforum with the text, archive duration, tag, and embed featuring the image.
Result:
CreatePostWithFileAsync() throws exception: System.AggregateException: 'One or more errors occurred. (The channel testforum requires posts to have at least one tag.)'.
Further Info:
Steps:
UncheckRequire people to select tags when posting in #testforum.
Create ForumTag[] tags containing the same ForumTag from #testforum as before.
Use CreatePostWithFileAsync(title, stream, fileName, archiveDuration, text, embed, tags) to create a post in #testforum.
Result:
A post is made in #testforum with the text, archive duration, tag, and embed featuring the image.
Despite the error that occurs when the forum requires tags implying that the tags are being skipped or ignored, they still show up when the post is created, meaning that the AggregateException is being thrown incorrectly.
Version
3.14.1
Logs
System.AggregateException: 'One or more errors occurred. (The channel testforum requires posts to have at least one tag.)'
Sample
Try first with tags required, then try again with tags optional.
ulong serverID, forumChannelID; //set to applicable values
//Get stream
string imgLink = "https://napchart.com/api/v2/getImage?chartid=motsliO4P"; //set to url for a png, I used this for testing
WebRequest request = WebRequest.Create(imgLink);
WebResponse response = request.GetResponse();
Stream stream = response.GetResponseStream();
string fileName = "img.png";
EmbedBuilder embed = new() { Title = "test" };
//get forum
SocketForumChannel forum = Bot.getSocketGuild(serverID).GetForumChannel(forumChannelID);
//get a tag from forum
ForumTag[] tags = forum.Tags.Where(t => t.Name.ToLower().Contains("sampleTag")).ToArray();
try
{
//Try with CreatePostWithFileAsync
await forum.CreatePostWithFileAsync("CreatePostWithFileAsync Test", stream, fileName, archiveDuration: ThreadArchiveDuration.ThreeDays,
text: "This is with FileAsync; currently only works when tags are disabled",
embed: embed.WithImageUrl($"attachment://{fileName}").Build(), tags: tags);
}
catch (Exception e)
{
Debug.WriteLine(e.Message);
}
try
{
//Try with CreatePostAsync
await forum.CreatePostAsync("CreatePostAsync Test", ThreadArchiveDuration.ThreeDays,
text: "This is without FileAsync; currently works when tags are enabled or disabled",
embed: embed.WithImageUrl(imgLink).Build(), tags: tags);
}
catch (Exception e)
{
Debug.WriteLine(e.Message);
}
Packages
Discord.Net (13.14.1)
Environment
OS: Windows 11 Pro 24H2 26100.1
Architecture: x64
SDK: .NET 6.0
The text was updated successfully, but these errors were encountered:
Check The Docs
Verify Issue Source
Check your intents
Description
Reproduction:
Steps:
#testforum
) channel with at least one tag.Require people to select tags when posting
in#testforum
.ForumTag[] tags
containing one valid ForumTag from#testforum
.CreatePostWithFileAsync(title, stream, fileName, archiveDuration, text, embed, tags)
to create a post in#testforum
.Expected Result:
A post is made in
#testforum
with the text, archive duration, tag, and embed featuring the image.Result:
CreatePostWithFileAsync()
throws exception:System.AggregateException: 'One or more errors occurred. (The channel testforum requires posts to have at least one tag.)'
.Further Info:
Steps:
Require people to select tags when posting
in#testforum
.ForumTag[] tags
containing the same ForumTag from#testforum
as before.CreatePostWithFileAsync(title, stream, fileName, archiveDuration, text, embed, tags)
to create a post in #testforum.Result:
A post is made in
#testforum
with the text, archive duration, tag, and embed featuring the image.Despite the error that occurs when the forum requires tags implying that the tags are being skipped or ignored, they still show up when the post is created, meaning that the AggregateException is being thrown incorrectly.
Version
3.14.1
Logs
System.AggregateException: 'One or more errors occurred. (The channel testforum requires posts to have at least one tag.)'
Sample
Try first with tags required, then try again with tags optional.
Packages
Discord.Net (13.14.1)
Environment
The text was updated successfully, but these errors were encountered: