pub struct CreateScheduledEvent<'a> { /* private fields */ }
builder
only.Expand description
Implementations§
Source§impl<'a> CreateScheduledEvent<'a>
impl<'a> CreateScheduledEvent<'a>
Sourcepub fn new(
kind: ScheduledEventType,
name: impl Into<String>,
scheduled_start_time: impl Into<Timestamp>,
) -> Self
pub fn new( kind: ScheduledEventType, name: impl Into<String>, scheduled_start_time: impl Into<Timestamp>, ) -> Self
Creates a builder with the provided kind, name, and start time, leaving all other fields empty.
Sourcepub fn channel_id<C: Into<ChannelId>>(self, channel_id: C) -> Self
pub fn channel_id<C: Into<ChannelId>>(self, channel_id: C) -> Self
Sets the channel id of the scheduled event. Required if Self::kind
is
ScheduledEventType::StageInstance
or ScheduledEventType::Voice
.
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Sets the name of the scheduled event, replacing the current value as set in Self::new
.
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Sets the description of the scheduled event.
Sourcepub fn start_time(self, timestamp: impl Into<Timestamp>) -> Self
pub fn start_time(self, timestamp: impl Into<Timestamp>) -> Self
Sets the start time of the scheduled event, replacing the current value as set in
Self::new
.
Sourcepub fn end_time(self, timestamp: impl Into<Timestamp>) -> Self
pub fn end_time(self, timestamp: impl Into<Timestamp>) -> Self
Sets the end time of the scheduled event. Required if Self::kind
is
ScheduledEventType::External
.
Sourcepub fn kind(self, kind: ScheduledEventType) -> Self
pub fn kind(self, kind: ScheduledEventType) -> Self
Sets the entity type of the scheduled event, replacing the current value as set in
Self::new
.
Sourcepub fn location(self, location: impl Into<String>) -> Self
pub fn location(self, location: impl Into<String>) -> Self
Sets the location of the scheduled event. Required to be set and non-empty if
Self::kind
is ScheduledEventType::External
.
Sourcepub fn image(self, image: &CreateAttachment) -> Self
pub fn image(self, image: &CreateAttachment) -> Self
Sets the cover image for the scheduled event.
Sourcepub fn audit_log_reason(self, reason: &'a str) -> Self
pub fn audit_log_reason(self, reason: &'a str) -> Self
Sets the request’s audit log reason.
Trait Implementations§
Source§impl Builder for CreateScheduledEvent<'_>
Available on crate feature http
only.
impl Builder for CreateScheduledEvent<'_>
http
only.Source§fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a new scheduled event in the guild with the data set, if any.
Note: Requires the Create Events permission.
§Errors
If the cache
is enabled, returns a ModelError::InvalidPermissions
if the current user
lacks permission. Otherwise returns Error::Http
, as well as if invalid data is given.
Source§type Context<'ctx> = GuildId
type Context<'ctx> = GuildId
type Built = ScheduledEvent
Source§impl<'a> Clone for CreateScheduledEvent<'a>
impl<'a> Clone for CreateScheduledEvent<'a>
Source§fn clone(&self) -> CreateScheduledEvent<'a>
fn clone(&self) -> CreateScheduledEvent<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> Debug for CreateScheduledEvent<'a>
impl<'a> Debug for CreateScheduledEvent<'a>
Auto Trait Implementations§
impl<'a> Freeze for CreateScheduledEvent<'a>
impl<'a> RefUnwindSafe for CreateScheduledEvent<'a>
impl<'a> Send for CreateScheduledEvent<'a>
impl<'a> Sync for CreateScheduledEvent<'a>
impl<'a> Unpin for CreateScheduledEvent<'a>
impl<'a> UnwindSafe for CreateScheduledEvent<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)