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

Create a scheduled event in a guild.

Once a guild is selected, you must choose one of three event types to create. The request builders will ensure you provide the correct data to Discord. See [Discord Docs/Create Guild Schedule Event].

The name must be between 1 and 100 characters in length. For external events, the location must be between 1 and 100 characters in length.

Examples

Create an event in a stage instance:

use twilight_model::{id::Id, util::Timestamp};
let guild_id = Id::new(1);
let channel_id = Id::new(2);
let garfield_start_time = Timestamp::parse("2022-01-01T14:00:00+00:00")?;

client
    .create_guild_scheduled_event(guild_id)
    .stage_instance(
        channel_id,
        "Garfield Appreciation Hour",
        &garfield_start_time,
    )?
    .description("Discuss: How important is Garfield to You?")?
    .exec()
    .await?;

Create an external event:

use twilight_model::{id::Id, util::Timestamp};
let guild_id = Id::new(1);
let garfield_con_start_time = Timestamp::parse("2022-01-04T08:00:00+00:00")?;
let garfield_con_end_time = Timestamp::parse("2022-01-06T17:00:00+00:00")?;

client
    .create_guild_scheduled_event(guild_id)
    .external(
        "Garfield Con 2022",
        "Baltimore Convention Center",
        &garfield_con_start_time,
        &garfield_con_end_time,
    )?
    .description(
        "In a spiritual successor to BronyCon, Garfield fans from \
around the globe celebrate all things related to the loveable cat.",
    )?
    .exec()
    .await?;

Implementations

Create an external scheduled event in a guild.

The name must be between 1 and 100 characters in length.

Errors

Returns an error of type ScheduledEventName if the name is invalid.

Create a stage instance scheduled event in a guild.

The name must be between 1 and 100 characters in length.

Errors

Returns an error of type ScheduledEventName if the name is invalid.

Create a voice channel scheduled event in a guild.

The name must be between 1 and 100 characters in length.

Errors

Returns an error of type ScheduledEventName if the name is invalid.

Trait Implementations

Attach an audit log reason to the request. 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