Struct serenity_rich_interaction::events::RichEventHandler [−][src]
pub struct RichEventHandler { /* fields omitted */ }
Expand description
A handler for raw serenity events
use serenity_rich_interaction::events::RichEventHandler;
use serenity::model::event;
use serenity::client::Client;
use serenity_rich_interaction::RegisterRichInteractions;
let mut handler = RichEventHandler::default();
handler.add_event(|ctx, e: &event::ReadyEvent| Box::pin(async move {
println!("Ready event received");
Ok(())
}));
let client = Client::builder("TOKEN").register_rich_interactions_with(handler).await?;
// ...
Implementations
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for RichEventHandler
impl Send for RichEventHandler
impl Sync for RichEventHandler
impl Unpin for RichEventHandler
impl !UnwindSafe for RichEventHandler
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
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