Table of Contents
API reference

Class DiscordLinkedRolesService

Namespace
DisCatSharp.Hosting.AspNetCore.LinkedRoles
Assembly
DisCatSharp.Hosting.AspNetCore.dll

Provides helper methods for linked-roles verification URLs, metadata synchronization, and OAuth role-connection updates.

public sealed class DiscordLinkedRolesService
Inheritance
DiscordLinkedRolesService
Inherited Members

Remarks

This helper keeps the ASP.NET Core ingress route configuration, Discord application metadata, and OAuth callback results aligned for linked-roles flows.

Constructors

DiscordLinkedRolesService(IOptions<DiscordAspNetCoreIngressOptions>, IOptions<DiscordLinkedRolesOptions>, IServiceProvider)

Provides helper methods for linked-roles verification URLs, metadata synchronization, and OAuth role-connection updates.

Methods

GetMetadataAsync(CancellationToken)

Resolves the linked-roles metadata records from the registered provider.

GetVerificationUrl(Uri)

Computes the public linked-roles verification URL for the supplied application base URL.

HasRoleConnectionsWriteScope(DiscordOAuthCallbackResult)

Gets a value indicating whether a callback result contains the required role_connections.write scope.

PublishRoleConnectionAsync(DiscordOAuth2Client, DiscordOAuthCallbackResult, string, string, ApplicationRoleConnectionMetadata, CancellationToken)

Publishes a linked-roles connection update using the access token captured by a successful OAuth callback.

SynchronizeMetadataAsync(DiscordClient, CancellationToken)

Synchronizes the registered linked-roles metadata with Discord when the local schema differs from the remote application state.

UpdateVerificationUrlAsync(BaseDiscordClient, Uri, CancellationToken)

Updates the current Discord application's linked-roles verification URL to the computed public URL.