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
namestringName of the guild.
regionstringVoice region of the guild.
iconOptional<Stream>Stream containing the icon for the guild.
verificationLevelDiscordVerificationLevel?Verification level for the guild.
defaultMessageNotificationsDiscordDefaultMessageNotifications?Default message notification settings for the guild.
systemChannelFlagsDiscordSystemChannelFlags?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.