Table of Contents

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

name string

Name of the template.

description string

Description of the template.

cancellationToken CancellationToken

A 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.