Table of Contents

Method CreateWebhookAsync

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

CreateWebhookAsync(string, Optional<Stream>, string)

Create a new webhook.

public Task<DiscordWebhook> CreateWebhookAsync(string name, Optional<Stream> avatar = default, string reason = null)

Parameters

name string

The name of the webhook.

avatar Optional<Stream>

The image for the default webhook avatar.

reason string

Reason for audit logs.

Returns

Task<DiscordWebhook>

Exceptions

UnauthorizedException

Thrown when the client does not have the ManageWebhooks permission.

NotFoundException

Thrown when the channel does not exist.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.