{"record":{"id":"a2c943f0e6f190ee","repo":"Tyrrrz/DiscordChatExporter","slug":"provided-bot-account-is-missing-the-message-conten","errorCode":null,"errorMessage":"Provided bot account is missing the MESSAGE_CONTENT privileged intent.","messagePattern":"Provided bot account is missing the MESSAGE_CONTENT privileged intent\\.","errorType":"exception","errorClass":"DiscordChatExporterException","httpStatus":null,"severity":"critical","filePath":"DiscordChatExporter.Core/Discord/DiscordClient.cs","lineNumber":206,"sourceCode":"        CancellationToken cancellationToken = default\n    )\n    {\n        var response = await GetJsonResponseAsync(\"applications/@me\", cancellationToken);\n        return Application.Parse(response);\n    }\n\n    private async ValueTask EnsureMessageContentIntentAsync(\n        CancellationToken cancellationToken = default\n    )\n    {\n        if (await ResolveTokenKindAsync(cancellationToken) != TokenKind.Bot)\n            return;\n\n        var application = await GetApplicationAsync(cancellationToken);\n        if (application.IsMessageContentIntentEnabled)\n            return;\n\n        throw new DiscordChatExporterException(\n            \"Provided bot account is missing the MESSAGE_CONTENT privileged intent.\",\n            true\n        );\n    }\n\n    public async ValueTask<User?> TryGetUserAsync(\n        Snowflake userId,\n        CancellationToken cancellationToken = default\n    )\n    {\n        var response = await TryGetJsonResponseAsync($\"users/{userId}\", cancellationToken);\n        return response?.Pipe(User.Parse);\n    }\n\n    public async IAsyncEnumerable<Guild> GetUserGuildsAsync(\n        [EnumeratorCancellation] CancellationToken cancellationToken = default\n    )\n    {","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/Tyrrrz/DiscordChatExporter/blob/f6865c82167c3bfee4455da80a1f1ca5e71b95ad/DiscordChatExporter.Core/Discord/DiscordClient.cs#L188-L224","documentation":"Thrown as DiscordChatExporterException(isFatal=true) by EnsureMessageContentIntentAsync when the resolved token is a bot token but the linked application does not have the MESSAGE_CONTENT privileged intent enabled. Without it, message content comes back empty, so the tool aborts rather than producing useless exports. isFatal stops the whole run because no channel will export correctly.","triggerScenarios":"ResolveTokenKindAsync returns TokenKind.Bot, then GetApplicationAsync returns an application whose IsMessageContentIntentEnabled is false. EnsureMessageContentIntentAsync (DiscordClient.cs:206) raises the exception before message fetching begins.","commonSituations":"Newly created bot that has not had privileged intents toggled on; bot configured for a different use case (moderation) without message intent; intent disabled by another admin in the Developer Portal; verified bot that must apply for the intent.","solutions":["Open the Discord Developer Portal > your application > Bot > Privileged Gateway Intents, and enable MESSAGE CONTENT INTENT.","Save and restart the export (intent changes take effect on the next authentication).","If the bot is verified (>=100 servers), apply for the intent via Discord's verification process.","Alternatively, use a user token (note: against Discord ToS) only if you accept the risk."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Requires a bot token; verify the application's intents before exporting\nvar app = await discord.GetApplicationAsync(ct);\nif (!app.IsMessageContentIntentEnabled)\n    throw new InvalidOperationException(\"Enable MESSAGE_CONTENT intent in the Developer Portal before exporting.\");","typeGuard":null,"tryCatchPattern":"try { await exporter.ExportChannelAsync(req, progress, ct); }\ncatch (DiscordChatExporterException ex) when (ex.Message.Contains(\"MESSAGE_CONTENT\"))\n{\n    logger.LogError(\"Enable the MESSAGE CONTENT intent in the Developer Portal, then rerun.\");\n    throw;\n}","preventionTips":["Enable MESSAGE CONTENT INTENT in the Developer Portal before first use.","Add a startup probe of GetApplicationAsync to fail fast on missing intent.","For verified bots, request the intent during Discord verification."],"tags":["authentication","bot","privileged-intent","configuration","fatal"],"backgroundTag":null,"analyzedSha":"f6865c82167c3bfee4455da80a1f1ca5e71b95ad","analyzedAt":"2026-08-13T18:08:46.403Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}