Try out new macro

This commit is contained in:
bitfl0wer 2023-08-15 16:58:06 +02:00
parent ec20258abe
commit 69c8b8d076
No known key found for this signature in database
GPG Key ID: 0ACD574FCF5226CF
1 changed files with 5 additions and 3 deletions

View File

@ -1,20 +1,21 @@
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use chorus_macros::Updateable; use chorus_macros::{observe_option_vec, Composite, Updateable};
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr}; use serde_repr::{Deserialize_repr, Serialize_repr};
use crate::gateway::Updateable; use crate::gateway::{GatewayHandle, Updateable};
use crate::types::types::guild_configuration::GuildFeaturesList; use crate::types::types::guild_configuration::GuildFeaturesList;
use crate::types::{ use crate::types::{
entities::{Channel, Emoji, RoleObject, Sticker, User, VoiceState, Webhook}, entities::{Channel, Emoji, RoleObject, Sticker, User, VoiceState, Webhook},
interfaces::WelcomeScreenObject, interfaces::WelcomeScreenObject,
utils::Snowflake, utils::Snowflake,
Composite,
}; };
/// See <https://discord.com/developers/docs/resources/guild> /// See <https://discord.com/developers/docs/resources/guild>
#[derive(Serialize, Deserialize, Debug, Default, Clone, Updateable)] #[derive(Serialize, Deserialize, Debug, Default, Clone, Updateable, Composite)]
#[cfg_attr(feature = "sqlx", derive(sqlx::FromRow))] #[cfg_attr(feature = "sqlx", derive(sqlx::FromRow))]
pub struct Guild { pub struct Guild {
pub afk_channel_id: Option<Snowflake>, pub afk_channel_id: Option<Snowflake>,
@ -29,6 +30,7 @@ pub struct Guild {
#[cfg_attr(feature = "sqlx", sqlx(skip))] #[cfg_attr(feature = "sqlx", sqlx(skip))]
pub bans: Option<Vec<GuildBan>>, pub bans: Option<Vec<GuildBan>>,
#[cfg_attr(feature = "sqlx", sqlx(skip))] #[cfg_attr(feature = "sqlx", sqlx(skip))]
#[observe_option_vec]
pub channels: Option<Vec<Arc<RwLock<Channel>>>>, pub channels: Option<Vec<Arc<RwLock<Channel>>>>,
pub default_message_notifications: Option<i32>, pub default_message_notifications: Option<i32>,
pub description: Option<String>, pub description: Option<String>,