Skip to content

Commit

Permalink
docs(oauth2web): document new proxy config gen methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Dec 8, 2023
1 parent 4163850 commit 72d8177
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions DisCatSharp.Extensions.OAuth2Web/OAuth2WebExtensionUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,17 @@

namespace DisCatSharp.Extensions.OAuth2Web;

/// <summary>
/// Provides extension methods for OAuth2Web.
/// </summary>
public static class OAuth2WebExtensionUtilities
{
/// <summary>
/// Generates the proxy configuration for apache2 hosts for use with a <see cref="DiscordShardedClient"/>.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="cancellationToken">The optional cancellation token.</param>
/// <returns>A file will be created in the executing directory with the name <c>dcs_oauth2web_sharded_proxy.conf</c>.</returns>
public static async Task GenerateApache2ProxyFileAsync(this DiscordShardedClient client, CancellationToken? cancellationToken = null)
{
var extensions = await client.GetOAuth2WebAsync();
Expand All @@ -54,6 +63,12 @@ public static async Task GenerateApache2ProxyFileAsync(this DiscordShardedClient
await File.WriteAllLinesAsync("dcs_oauth2web_sharded_proxy.conf", proxyStrings, Encoding.UTF8, cancellationToken ?? CancellationToken.None);
}

/// <summary>
/// Generates the proxy configuration for apache2 hosts for use with a single <see cref="DiscordClient"/>.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="cancellationToken">The optional cancellation token.</param>
/// <returns>A file will be created in the executing directory with the name <c>dcs_oauth2web_proxy.conf</c>.</returns>
public static async Task GenerateApache2ProxyFileAsync(this DiscordClient client, CancellationToken? cancellationToken = null)
{
var extensions = client.GetOAuth2Web();
Expand Down

0 comments on commit 72d8177

Please sign in to comment.