rename APIError in ErrorField vec as well

This commit is contained in:
Zertex 2023-05-27 13:50:28 -04:00
parent 6d747bc504
commit 665a3b3667
4 changed files with 18 additions and 5 deletions

View File

@ -33,7 +33,7 @@ pub struct Guild {
#[cfg_attr(feature = "sqlx", sqlx(skip))]
pub emojis: Vec<Emoji>,
#[cfg_attr(feature = "sqlx", sqlx(skip))]
pub features: Vec<String>,
pub features: String, // TODO: Make this a 'simple-array'
pub application_id: Option<String>,
pub system_channel_id: Option<Snowflake>,
pub system_channel_flags: Option<u8>,

View File

@ -16,8 +16,10 @@ pub struct RoleObject {
pub permissions: String,
pub managed: bool,
pub mentionable: bool,
// to:do add role tags https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure
//pub tags: Option<RoleTags>
#[cfg(feature = "sqlx")]
pub tags: Option<sqlx::types::Json<RoleTags>>,
#[cfg(not(feature = "sqlx"))]
pub tags: Option<RoleTags>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
@ -27,3 +29,13 @@ pub struct RoleSubscriptionData {
pub total_months_subscribed: u32,
pub is_renewal: bool,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RoleTags {
pub bot_id: Option<Snowflake>,
pub integration_id: Option<Snowflake>,
pub premium_subscriber: Option<bool>,
pub subscription_listing_id: Option<Snowflake>,
pub available_for_purchase: Option<bool>,
pub guild_connections: Option<bool>,
}

View File

@ -44,7 +44,7 @@ pub struct IntermittentError {
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct ErrorField {
#[serde(default)]
pub _errors: Vec<APIError>,
pub _errors: Vec<APIErrorPayload>,
}
#[derive(Serialize, Deserialize, Debug)]

View File

@ -1,6 +1,7 @@
pub use config::*;
pub use entities::*;
pub use errors::*;
//pub use errors::*;
pub use events::*;
pub use interfaces::*;
pub use schema::*;