Tyrrrz/DiscordChatExporter · error · DiscordChatExporterException
Request to '{url}' failed: not found.
Error message
Request to '{url}' failed: not found. What it means
Thrown as DiscordChatExporterException (non-fatal) from GetJsonResponseAsync when a request returns 404 Not Found. The requested resource (channel, guild, user, message) does not exist or is not visible to the authenticated identity. The url is interpolated into the message for diagnosis.
Source
Thrown at DiscordChatExporter.Core/Discord/DiscordClient.cs:154
CancellationToken cancellationToken = default
)
{
using var response = await GetResponseAsync(url, cancellationToken);
if (!response.IsSuccessStatusCode)
{
throw response.StatusCode switch
{
HttpStatusCode.Unauthorized => throw new DiscordChatExporterException(
"Authentication token is invalid.",
true
),
HttpStatusCode.Forbidden => throw new DiscordChatExporterException(
$"Request to '{url}' failed: forbidden."
),
HttpStatusCode.NotFound => throw new DiscordChatExporterException(
$"Request to '{url}' failed: not found."
),
_ => throw new DiscordChatExporterException(
$"""
Request to '{url}' failed: {response
.StatusCode.ToString()
.SeparateWords(' ')
.ToLowerInvariant()}.
Response content: {await response.Content.ReadAsStringAsync(
cancellationToken
)}
""",
true
),
};
}
View on GitHub (pinned to f6865c8216)
Solutions
- Re-copy the ID with Developer Mode enabled (right-click > Copy ID).
- Confirm the channel/guild still exists and the identity can see it.
- Distinguish ID types: guild ID vs channel ID vs message ID — use the correct one for each command.
- Remove stale IDs from your export list.
Defensive patterns
Strategy: validation
Validate before calling
if (!Snowflake.TryParse(channelIdRaw, null).HasValue)
throw new ArgumentException($"'{channelIdRaw}' is not a valid snowflake.");
var channel = await discord.TryGetChannelAsync(guildId, channelId, ct);
if (channel is null) throw new ArgumentException($"Channel {channelId} not found/visible."); Try / catch
try { await exporter.ExportChannelAsync(req, progress, ct); }
catch (DiscordChatExporterException ex) when (ex.Message.Contains("not found"))
{
logger.LogWarning("Channel {Id} not found — skipping", req.Channel.Id);
} Prevention
- Copy IDs via Developer Mode > Copy ID, not from URLs.
- Validate snowflake format before queuing an export.
- Filter out deleted channel IDs from saved export lists.
When it happens
Trigger: Any GetJsonResponseAsync call returning HttpStatusCode.NotFound. Typical: requesting a channel/guild/user ID that was deleted, never existed, or is not reachable with the current token.
Common situations: Typo in a snowflake ID; channel/guild deleted between planning and export; copied an ID from the wrong Discord surface (e.g., a message ID used where a channel ID was needed); bot removed from the guild so its routes 404.
Related errors
- Authentication token is invalid.
- Request to '{url}' failed: forbidden.
- Request to '{url}' failed: {response.StatusCode.ToString().S
- Invalid snowflake '{value}'.
AI-assisted analysis of Tyrrrz/DiscordChatExporter@f6865c8216 (2026-08-13).
Data as JSON: /api/errors/8453d75a757ea710.
Report an issue: GitHub.