Method CreateGuildFromTemplateAsync
- Namespace
- DSharpPlus
- Assembly
- DSharpPlus.dll
CreateGuildFromTemplateAsync(string, string, Optional<Stream>)
Creates a guild from a template. This requires the bot to be in less than 10 guilds total.
public Task<DiscordGuild> CreateGuildFromTemplateAsync(string code, string name, Optional<Stream> icon = default)
Parameters
code
stringThe template code.
name
stringName of the guild.
icon
Optional<Stream>Stream containing the icon for the guild.
Returns
- Task<DiscordGuild>
The created guild.
Exceptions
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.