pub struct ScheduledEventManager<'a, B: Backend> { /* private fields */ }Expand description
The scheduled events of one guild. Returned by Context::scheduled_events.
Events fetched from Discord carry their interested-user count (user_count).
discord.js counterpart: GuildScheduledEventManager (guild.scheduledEvents).
Implementations§
Source§impl<'a, B: Backend> ScheduledEventManager<'a, B>
impl<'a, B: Backend> ScheduledEventManager<'a, B>
Sourcepub const fn guild_id(self) -> GuildId
pub const fn guild_id(self) -> GuildId
The guild these events belong to.
discord.js counterpart: GuildScheduledEventManager#guild.
Sourcepub fn cache(
self,
) -> Option<GuildView<'a, ScheduledEventId, GuildScheduledEvent, B>>
pub fn cache( self, ) -> Option<GuildView<'a, ScheduledEventId, GuildScheduledEvent, B>>
The cached events of the guild, if the client has a cache.
discord.js counterpart: GuildScheduledEventManager#cache.
Sourcepub fn fetch(
self,
event_id: ScheduledEventId,
) -> Fetch<Arc<GuildScheduledEvent>, impl Future<Output = Result<Arc<GuildScheduledEvent>, Error>> + Send + 'a>
pub fn fetch( self, event_id: ScheduledEventId, ) -> Fetch<Arc<GuildScheduledEvent>, impl Future<Output = Result<Arc<GuildScheduledEvent>, Error>> + Send + 'a>
An event: the cached one, or Get Guild Scheduled Event, whose result is cached.
discord.js counterpart: GuildScheduledEventManager#fetch(id).
§Errors
Returns the REST error if Discord was asked and the request failed.
Sourcepub async fn list(
self,
) -> Result<Collection<ScheduledEventId, Arc<GuildScheduledEvent>>, Error>
pub async fn list( self, ) -> Result<Collection<ScheduledEventId, Arc<GuildScheduledEvent>>, Error>
Every scheduled event of the guild (List Scheduled Events for Guild); the events are cached.
discord.js counterpart: GuildScheduledEventManager#fetch().
§Errors
Returns the REST error if the request failed.
Sourcepub async fn create(
self,
body: &CreateGuildScheduledEvent,
reason: Option<&str>,
) -> Result<Arc<GuildScheduledEvent>, Error>
pub async fn create( self, body: &CreateGuildScheduledEvent, reason: Option<&str>, ) -> Result<Arc<GuildScheduledEvent>, Error>
Creates an event (Create Guild Scheduled Event); it is cached.
discord.js counterpart: GuildScheduledEventManager#create.
§Errors
Returns the REST error if the request failed (it needs CREATE_EVENTS).
Sourcepub async fn edit(
self,
event_id: ScheduledEventId,
body: &ModifyGuildScheduledEvent,
reason: Option<&str>,
) -> Result<Arc<GuildScheduledEvent>, Error>
pub async fn edit( self, event_id: ScheduledEventId, body: &ModifyGuildScheduledEvent, reason: Option<&str>, ) -> Result<Arc<GuildScheduledEvent>, Error>
Edits an event, also to start, end or cancel it (Modify Guild Scheduled Event); the result is cached.
discord.js counterpart: GuildScheduledEventManager#edit.
§Errors
Returns the REST error if the request failed (it needs MANAGE_EVENTS).
Sourcepub async fn delete(self, event_id: ScheduledEventId) -> Result<(), Error>
pub async fn delete(self, event_id: ScheduledEventId) -> Result<(), Error>
Deletes an event (Delete Guild Scheduled
Event; Discord takes no audit-log
reason). The cache is updated by the GUILD_SCHEDULED_EVENT_DELETE event that
follows (D-236).
discord.js counterpart: GuildScheduledEventManager#delete.
§Errors
Returns the REST error if the request failed.
Sourcepub async fn users(
self,
event_id: ScheduledEventId,
query: &GetGuildScheduledEventUsers,
) -> Result<Collection<UserId, GuildScheduledEventUser>, Error>
pub async fn users( self, event_id: ScheduledEventId, query: &GetGuildScheduledEventUsers, ) -> Result<Collection<UserId, GuildScheduledEventUser>, Error>
A page of the users interested in an event, by user ID (Get Guild Scheduled Event Users).
discord.js counterpart: GuildScheduledEventManager#fetchSubscribers.
§Errors
Returns the REST error if the request failed.
Trait Implementations§
Source§impl<B: Backend> Clone for ScheduledEventManager<'_, B>
impl<B: Backend> Clone for ScheduledEventManager<'_, B>
impl<B: Backend> Copy for ScheduledEventManager<'_, B>
Auto Trait Implementations§
impl<'a, B> !RefUnwindSafe for ScheduledEventManager<'a, B>
impl<'a, B> !UnwindSafe for ScheduledEventManager<'a, B>
impl<'a, B> Freeze for ScheduledEventManager<'a, B>
impl<'a, B> Send for ScheduledEventManager<'a, B>
impl<'a, B> Sync for ScheduledEventManager<'a, B>
impl<'a, B> Unpin for ScheduledEventManager<'a, B>
impl<'a, B> UnsafeUnpin for ScheduledEventManager<'a, B>
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more