diff --git a/crates/core/database/src/util/bridge/v0.rs b/crates/core/database/src/util/bridge/v0.rs index c60fee27..4439134d 100644 --- a/crates/core/database/src/util/bridge/v0.rs +++ b/crates/core/database/src/util/bridge/v0.rs @@ -329,7 +329,11 @@ impl From for Message { embeds: value.embeds, mentions: value.mentions, replies: value.replies, - reactions: value.reactions, + reactions: value + .reactions + .into_iter() + .map(|(k, v)| (k, v.into_iter().collect())) + .collect(), interactions: value.interactions.into(), masquerade: value.masquerade.map(|masq| masq.into()), } @@ -353,7 +357,12 @@ impl From for PartialMessage { embeds: value.embeds, mentions: value.mentions, replies: value.replies, - reactions: value.reactions, + reactions: value.reactions.map(|reactions| { + reactions + .into_iter() + .map(|(k, v)| (k, v.into_iter().collect())) + .collect() + }), interactions: value.interactions.map(|interactions| interactions.into()), masquerade: value.masquerade.map(|masq| masq.into()), } @@ -385,7 +394,9 @@ impl From for SystemMessage { impl From for Interactions { fn from(value: crate::Interactions) -> Self { Interactions { - reactions: value.reactions, + reactions: value + .reactions + .map(|reactions| reactions.into_iter().collect()), restrict_reactions: value.restrict_reactions, } } diff --git a/crates/core/database/src/util/idempotency.rs b/crates/core/database/src/util/idempotency.rs index 1db20993..548e2d98 100644 --- a/crates/core/database/src/util/idempotency.rs +++ b/crates/core/database/src/util/idempotency.rs @@ -4,12 +4,6 @@ use revolt_result::{create_error, Error, Result}; use async_std::sync::Mutex; use once_cell::sync::Lazy; -use revolt_rocket_okapi::gen::OpenApiGenerator; -use revolt_rocket_okapi::request::{OpenApiFromRequest, RequestHeaderInput}; -use revolt_rocket_okapi::revolt_okapi::openapi3::{Parameter, ParameterValue}; -use rocket::http::Status; -use rocket::request::{FromRequest, Outcome}; -use schemars::schema::{InstanceType, SchemaObject, SingleOrVec}; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize)] @@ -42,6 +36,17 @@ impl IdempotencyKey { } } +#[cfg(feature = "rocket-impl")] +use revolt_rocket_okapi::{ + gen::OpenApiGenerator, + request::{OpenApiFromRequest, RequestHeaderInput}, + revolt_okapi::openapi3::{Parameter, ParameterValue}, +}; + +#[cfg(feature = "rocket-impl")] +use schemars::schema::{InstanceType, SchemaObject, SingleOrVec}; + +#[cfg(feature = "rocket-impl")] impl<'r> OpenApiFromRequest<'r> for IdempotencyKey { fn from_request_input( _gen: &mut OpenApiGenerator, @@ -71,6 +76,13 @@ impl<'r> OpenApiFromRequest<'r> for IdempotencyKey { } } +#[cfg(feature = "rocket-impl")] +use rocket::{ + http::Status, + request::{FromRequest, Outcome}, +}; + +#[cfg(feature = "rocket-impl")] #[async_trait] impl<'r> FromRequest<'r> for IdempotencyKey { type Error = Error;