Table of Contents
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

client DiscordClient

The Discord client used to manage application metadata.

cancellationToken CancellationToken

A 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

client is null.

InvalidOperationException

The registered metadata provider is missing or returned invalid metadata.