pub struct CreateGuild<'a> { /* private fields */ }
Expand description

Create a new request to create a guild.

The minimum length of the name is 2 UTF-16 characters and the maximum is 100 UTF-16 characters. This endpoint can only be used by bots in less than 10 guilds.

Implementations

Add a role to the list of roles.

Set the ID of the AFK voice channel.

This must be an ID specified in channels.

Set the AFK timeout, in seconds.

Set the channels to create with the guild.

The maximum number of channels that can be provided is 500.

Examples
use twilight_http::{
    request::guild::create_guild::{
        CategoryFieldsBuilder, GuildChannelFieldsBuilder, TextFieldsBuilder, VoiceFieldsBuilder,
    },
    Client,
};

let text = TextFieldsBuilder::new("text channel".to_owned())?.build();
let voice = VoiceFieldsBuilder::new("voice channel".to_owned())?.build();
let text2 = TextFieldsBuilder::new("other text channel".to_owned())?
    .topic("posting".to_owned())?
    .build();

let category = CategoryFieldsBuilder::new("category channel".to_owned())?
    .add_text(text2)
    .add_voice(voice);

let channels = GuildChannelFieldsBuilder::new()
    .add_text(text)
    .add_category_builder(category)
    .build();

let guild = client
    .create_guild("guild name".to_owned())?
    .channels(channels)?
    .await?;
Errors

Returns a CreateGuildErrorType::TooManyChannels error type if the number of channels is over 500.

Set the default message notification level. See Discord Docs/Create Guild.

Set the explicit content filter level.

Set the icon.

This must be a Data URI, in the form of data:image/{type};base64,{data} where {type} is the image MIME type and {data} is the base64-encoded image. See Discord Docs/Image Data.

Override the everyone role of the guild.

If there are not yet roles set with roles, this will create a role override in the first position. Discord understands the first role in the list to override @everyone. If there are roles, this replaces the first role in the position.

Set the channel where system messages will be posted.

This must be an ID specified in channels.

Set the guild’s SystemChannelFlags.

Set the roles to create with the guild.

The maximum number of roles that can be provided is 250.

Examples
use twilight_http::{request::guild::create_guild::RoleFieldsBuilder, Client};

let roles = vec![RoleFieldsBuilder::new("role 1".to_owned())
    .color(0x543923)?
    .build()];
client
    .create_guild("guild name".to_owned())?
    .roles(roles)?
    .await?;
Errors

Returns a CreateGuildErrorType::TooManyRoles error type if the number of roles is over 250.

👎Deprecated since 0.14.0: use .await or into_future instead

Execute the request, returning a future resolving to a Response.

Trait Implementations

The output that the future will produce on completion.
Which kind of future are we turning this into?
Creates a future from a value. Read more
Try to convert a request builder into a raw Request. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more