API reference
Method SynchronizeMetadataAsync
- Namespace
- DisCatSharp.Hosting.AspNetCore.LinkedRoles
- Assembly
- DisCatSharp.Hosting.AspNetCore.dll
SynchronizeMetadataAsync(DiscordClient, CancellationToken)
Synchronizes the registered linked-roles metadata with Discord when the local schema differs from the remote application state.
public Task<IReadOnlyList<DiscordApplicationRoleConnectionMetadata>> SynchronizeMetadataAsync(DiscordClient client, CancellationToken cancellationToken = default)
Parameters
clientDiscordClientThe Discord client used to manage application metadata.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<IReadOnlyList<DiscordApplicationRoleConnectionMetadata>>
The active metadata records after synchronization.
Remarks
The synchronization check is order-sensitive because Discord preserves the metadata array order exposed in the developer portal.
Exceptions
- ArgumentNullException
clientis null.- InvalidOperationException
The registered metadata provider is missing or returned invalid metadata.