Method HydrateAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
HydrateAsync(AuditLogHydrationTargets, bool, CancellationToken)
Replaces audit log placeholder references with cached or freshly fetched live entities.
public Task HydrateAsync(AuditLogHydrationTargets targets = AuditLogHydrationTargets.All, bool force = true, CancellationToken cancellationToken = default)
Parameters
targetsAuditLogHydrationTargetsControls which reference groups should be hydrated.
forceboolControls whether the helper may perform REST requests when the requested entities are not already cached.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
- Task
A task representing the asynchronous hydration operation.
Remarks
Audit log parsing intentionally avoids implicit REST calls and may therefore expose partial synthetic entities. Calling this method allows consumers to opt into upgrading those references after parsing.
When force is false, only cached entities are used and no network
request is issued. When it is true, the helper fetches live entities for resolvable
references where DisCatSharp exposes an appropriate retrieval API.
Missing or deleted targets are treated as a best-effort miss and leave the existing partial reference in place. Other API failures still bubble to the caller.
Exceptions
- UnauthorizedException
Thrown when Discord denies one of the requested live fetches.
- BadRequestException
Thrown when Discord rejects one of the requested live fetches.
- ServerErrorException
Thrown when Discord is unable to process one of the requested live fetches.