Method CreateWebhookAsync
- Namespace
- DSharpPlus.Entities
- Assembly
- DSharpPlus.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
stringThe name of the webhook.
avatar
Optional<Stream>The image for the default webhook avatar.
reason
stringReason 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.