Table of Contents

Method AddWebhookAsync

Namespace
DisCatSharp
Assembly
DisCatSharp.dll

AddWebhookAsync(ulong, string, CancellationToken)

Registers a webhook with this client. This retrieves a webhook based on the ID and token supplied.

public Task<DiscordWebhook> AddWebhookAsync(ulong id, string token, CancellationToken cancellationToken = default)

Parameters

id ulong

The ID of the webhook to add.

token string

The token of the webhook to add.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordWebhook>

The registered webhook.

AddWebhookAsync(Uri)

Registers a webhook with this client. This retrieves a webhook from webhook URL.

public Task<DiscordWebhook> AddWebhookAsync(Uri url)

Parameters

url Uri

URL of the webhook to retrieve. This URL must contain both ID and token.

Returns

Task<DiscordWebhook>

The registered webhook.

AddWebhookAsync(ulong, BaseDiscordClient, CancellationToken)

Registers a webhook with this client. This retrieves a webhook using the supplied full discord client.

public Task<DiscordWebhook> AddWebhookAsync(ulong id, BaseDiscordClient client, CancellationToken cancellationToken = default)

Parameters

id ulong

ID of the webhook to register.

client BaseDiscordClient

Discord client to which the webhook will belong.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordWebhook>

The registered webhook.