{"record":{"id":"d50069be9f5dfa48","repo":"Tyrrrz/DiscordChatExporter","slug":"channel-request-channel-name-of-guild-reques","errorCode":null,"errorMessage":"Channel '{request.Channel.Name}' of guild '{request.Guild.Name}' is a forum and cannot be exported directly. You need to pull its threads and export them individually.","messagePattern":"Channel '(.+?)' of guild '(.+?)' is a forum and cannot be exported directly\\. You need to pull its threads and export them individually\\.","errorType":"exception","errorClass":"DiscordChatExporterException","httpStatus":null,"severity":"error","filePath":"DiscordChatExporter.Core/Exporting/ChannelExporter.cs","lineNumber":22,"sourceCode":"using DiscordChatExporter.Core.Discord;\nusing DiscordChatExporter.Core.Discord.Data;\nusing DiscordChatExporter.Core.Exceptions;\nusing Gress;\n\nnamespace DiscordChatExporter.Core.Exporting;\n\npublic class ChannelExporter(DiscordClient discord)\n{\n    public async ValueTask ExportChannelAsync(\n        ExportRequest request,\n        IProgress<Percentage>? progress = null,\n        CancellationToken cancellationToken = default\n    )\n    {\n        // Forum channels don't have messages, they are just a list of threads\n        if (request.Channel.Kind == ChannelKind.GuildForum)\n        {\n            throw new DiscordChatExporterException(\n                $\"Channel '{request.Channel.Name}' \"\n                    + $\"of guild '{request.Guild.Name}' \"\n                    + $\"is a forum and cannot be exported directly. \"\n                    + \"You need to pull its threads and export them individually.\"\n            );\n        }\n\n        // Build context\n        var context = new ExportContext(discord, request);\n        await context.PopulateChannelsAndRolesAsync(cancellationToken);\n\n        // Initialize the exporter before further checks to ensure the file is created even if\n        // an exception is thrown after this point.\n        await using var messageExporter = new MessageExporter(context);\n\n        // Check if the channel is empty\n        if (request.Channel.IsEmpty)\n        {","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/Tyrrrz/DiscordChatExporter/blob/f6865c82167c3bfee4455da80a1f1ca5e71b95ad/DiscordChatExporter.Core/Exporting/ChannelExporter.cs#L4-L40","documentation":"Thrown as DiscordChatExporterException by ChannelExporter.ExportChannelAsync when the target channel's Kind is GuildForum. Forum channels hold no direct messages — only a collection of threads — so exporting them directly would produce nothing. The tool tells the user to export the forum's threads individually instead.","triggerScenarios":"ExportChannelAsync is called with a request whose request.Channel.Kind == ChannelKind.GuildForum (ChannelExporter.cs:21). This happens when exportchat is pointed at a forum channel ID.","commonSituations":"User grabs a forum channel ID and runs exportchat on it; a guild-level exportall flattens forum channels into direct export calls; forum channel reused as a regular channel after a type change.","solutions":["Use exportall/exportguild with --include-threads set to Archived, Unarchived, or All so forum threads are pulled and exported individually.","List the forum's threads and export each thread ID with exportchat.","Exclude forum channels from a batch export if you do not want their threads."],"exampleFix":"// before\ndotnet run -- exportchat -c <forum-channel-id> -t <token>\n// after\ndotnet run -- exportall -c <forum-channel-id> -t <token> --include-threads all","handlingStrategy":"validation","validationCode":"var channel = await discord.GetChannelAsync(channelId, ct);\nif (channel.Kind == ChannelKind.GuildForum)\n    throw new InvalidOperationException(\"Use exportall --include-threads to export a forum's threads.\");","typeGuard":"static bool IsForum(Channel c) => c.Kind == ChannelKind.GuildForum;","tryCatchPattern":"try { await exporter.ExportChannelAsync(req, progress, ct); }\ncatch (DiscordChatExporterException ex) when (ex.Message.Contains(\"forum\"))\n{\n    logger.LogInformation(\"{Channel} is a forum — rerun with --include-threads\", req.Channel.Name);\n}","preventionTips":["Inspect channel.Kind before calling ExportChannelAsync.","Use the exportall command with --include-threads for forums.","Filter forum channels out of direct-export lists."],"tags":["export","forum","threads","channel-type"],"backgroundTag":null,"analyzedSha":"f6865c82167c3bfee4455da80a1f1ca5e71b95ad","analyzedAt":"2026-08-13T18:08:46.403Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}