use std::sync::Arc; use async_trait::async_trait; use twilight_model::gateway::payload::incoming::InteractionCreate; use crate::framework::commands::extras::ExtrasGetter; use crate::framework::events::traits::{EventResult, OnInteractionHandler}; use crate::framework::runtime::Runtime; #[derive(Debug)] pub struct InteractionRunner; #[async_trait] impl OnInteractionHandler for InteractionRunner where T: Send + Sync + 'static, E: Send + Sync + 'static, { async fn on_interaction( &self, event: &InteractionCreate, rt: Arc>, extras: Arc>, ) -> EventResult { Ok(rt.registry.execute(event, rt.clone(), extras).await?) } }