#[non_exhaustive]pub struct CreateGuildScheduledEvent {
pub channel_id: Option<ChannelId>,
pub entity_metadata: Option<EntityMetadata>,
pub name: CompactString,
pub privacy_level: PrivacyLevel,
pub scheduled_start_time: Timestamp,
pub scheduled_end_time: Option<Timestamp>,
pub description: Option<CompactString>,
pub entity_type: EntityType,
pub image: Option<ImageData>,
pub recurrence_rule: Option<RecurrenceRuleData>,
}Expand description
The body of Create Guild Scheduled Event.
Build it with the constructor of the event’s place (D-125) — stage,
voice or external — which sets the fields that place
requires; the rest are optional. A guild can have at most 100 scheduled or active events.
discord.js counterpart: GuildScheduledEventCreateOptions.
§Examples
use djs_model::{rest::CreateGuildScheduledEvent, util::Timestamp};
let start = Timestamp::parse("2026-11-20T18:00:00Z")?;
let end = Timestamp::parse("2026-11-20T20:00:00Z")?;
let mut body = CreateGuildScheduledEvent::external("Rust meetup, Kraków", "Meetup", start, end);
body.description = Some("Talks and pizza".into());
let json = serde_json::to_string(&body)?;
assert!(json.starts_with(r#"{"entity_metadata":{"location":"Rust meetup, Kraków"},"name":"Meetup","privacy_level":2,"#));
assert!(json.ends_with(r#""description":"Talks and pizza","entity_type":3}"#));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.channel_id: Option<ChannelId>The stage or voice channel (not for external events).
entity_metadata: Option<EntityMetadata>The location of an external event.
name: CompactStringThe name (1-100 characters).
privacy_level: PrivacyLevelWho can see the event (only PrivacyLevel::GuildOnly exists).
scheduled_start_time: TimestampWhen the event starts.
scheduled_end_time: Option<Timestamp>When the event ends (required for external events).
description: Option<CompactString>The description (1-1000 characters).
entity_type: EntityTypeWhere the event takes place.
image: Option<ImageData>The cover image.
recurrence_rule: Option<RecurrenceRuleData>How the event repeats.
Implementations§
Source§impl CreateGuildScheduledEvent
impl CreateGuildScheduledEvent
Sourcepub fn stage(
channel_id: ChannelId,
name: impl Into<CompactString>,
start: Timestamp,
) -> Self
pub fn stage( channel_id: ChannelId, name: impl Into<CompactString>, start: Timestamp, ) -> Self
An event in the stage channel channel_id.
discord.js counterpart: GuildScheduledEventCreateOptions with a stage channel.
Sourcepub fn voice(
channel_id: ChannelId,
name: impl Into<CompactString>,
start: Timestamp,
) -> Self
pub fn voice( channel_id: ChannelId, name: impl Into<CompactString>, start: Timestamp, ) -> Self
An event in the voice channel channel_id.
discord.js counterpart: GuildScheduledEventCreateOptions with a voice channel.
Sourcepub fn external(
location: impl Into<CompactString>,
name: impl Into<CompactString>,
start: Timestamp,
end: Timestamp,
) -> Self
pub fn external( location: impl Into<CompactString>, name: impl Into<CompactString>, start: Timestamp, end: Timestamp, ) -> Self
An event outside Discord’s voice channels, at location (1-100 characters), from
start to end.
discord.js counterpart: GuildScheduledEventCreateOptions with entityMetadata.location.