Tyrrrz/DiscordChatExporter · critical · DiscordChatExporterException

Provided bot account is missing the MESSAGE_CONTENT privileg

Error message

Provided bot account is missing the MESSAGE_CONTENT privileged intent.

What it means

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.

Source

Thrown at DiscordChatExporter.Core/Discord/DiscordClient.cs:206

        CancellationToken cancellationToken = default
    )
    {
        var response = await GetJsonResponseAsync("applications/@me", cancellationToken);
        return Application.Parse(response);
    }

    private async ValueTask EnsureMessageContentIntentAsync(
        CancellationToken cancellationToken = default
    )
    {
        if (await ResolveTokenKindAsync(cancellationToken) != TokenKind.Bot)
            return;

        var application = await GetApplicationAsync(cancellationToken);
        if (application.IsMessageContentIntentEnabled)
            return;

        throw new DiscordChatExporterException(
            "Provided bot account is missing the MESSAGE_CONTENT privileged intent.",
            true
        );
    }

    public async ValueTask<User?> TryGetUserAsync(
        Snowflake userId,
        CancellationToken cancellationToken = default
    )
    {
        var response = await TryGetJsonResponseAsync($"users/{userId}", cancellationToken);
        return response?.Pipe(User.Parse);
    }

    public async IAsyncEnumerable<Guild> GetUserGuildsAsync(
        [EnumeratorCancellation] CancellationToken cancellationToken = default
    )
    {

View on GitHub (pinned to f6865c8216)

Solutions

  1. Open the Discord Developer Portal > your application > Bot > Privileged Gateway Intents, and enable MESSAGE CONTENT INTENT.
  2. Save and restart the export (intent changes take effect on the next authentication).
  3. If the bot is verified (>=100 servers), apply for the intent via Discord's verification process.
  4. Alternatively, use a user token (note: against Discord ToS) only if you accept the risk.
Defensive patterns

Strategy: validation

Validate before calling

// Requires a bot token; verify the application's intents before exporting
var app = await discord.GetApplicationAsync(ct);
if (!app.IsMessageContentIntentEnabled)
    throw new InvalidOperationException("Enable MESSAGE_CONTENT intent in the Developer Portal before exporting.");

Try / catch

try { await exporter.ExportChannelAsync(req, progress, ct); }
catch (DiscordChatExporterException ex) when (ex.Message.Contains("MESSAGE_CONTENT"))
{
    logger.LogError("Enable the MESSAGE CONTENT intent in the Developer Portal, then rerun.");
    throw;
}

Prevention

When it happens

Trigger: ResolveTokenKindAsync returns TokenKind.Bot, then GetApplicationAsync returns an application whose IsMessageContentIntentEnabled is false. EnsureMessageContentIntentAsync (DiscordClient.cs:206) raises the exception before message fetching begins.

Common situations: 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.

Related errors


AI-assisted analysis of Tyrrrz/DiscordChatExporter@f6865c8216 (2026-08-13). Data as JSON: /api/errors/a2c943f0e6f190ee. Report an issue: GitHub.