Table of Contents

Method CreateGuildAsync

Namespace
DSharpPlus
Assembly
DSharpPlus.dll

CreateGuildAsync(string, string?, Optional<Stream>, DiscordVerificationLevel?, DiscordDefaultMessageNotifications?, DiscordSystemChannelFlags?)

Creates a guild. This requires the bot to be in less than 10 guilds total.

public Task<DiscordGuild> CreateGuildAsync(string name, string? region = null, Optional<Stream> icon = default, DiscordVerificationLevel? verificationLevel = null, DiscordDefaultMessageNotifications? defaultMessageNotifications = null, DiscordSystemChannelFlags? systemChannelFlags = null)

Parameters

name string

Name of the guild.

region string

Voice region of the guild.

icon Optional<Stream>

Stream containing the icon for the guild.

verificationLevel DiscordVerificationLevel?

Verification level for the guild.

defaultMessageNotifications DiscordDefaultMessageNotifications?

Default message notification settings for the guild.

systemChannelFlags DiscordSystemChannelFlags?

System channel flags fopr the guild.

Returns

Task<DiscordGuild>

The created guild.

Exceptions

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.