Method CreateTemplateAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
CreateTemplateAsync(string, string?, CancellationToken)
Creates a guild template.
public Task<DiscordGuildTemplate> CreateTemplateAsync(string name, string? description = null, CancellationToken cancellationToken = default)
Parameters
namestringName of the template.
descriptionstringDescription of the template.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
- Task<DiscordGuildTemplate>
The template created.
Exceptions
- BadRequestException
Throws when a template already exists for the guild or a null parameter is provided for the name.
- UnauthorizedException
Throws when the client does not have the ManageGuild permission.
- ServerErrorException
Thrown when Discord is unable to process the request.