diff --git a/src/types/events/presence.rs b/src/types/events/presence.rs index 9fe7c1e..09d0739 100644 --- a/src/types/events/presence.rs +++ b/src/types/events/presence.rs @@ -20,7 +20,9 @@ pub struct UpdatePresence { #[derive(Debug, Deserialize, Serialize, Default, Clone, PartialEq, WebSocketEvent)] /// Received to tell the client that a user updated their presence / status +/// /// See +/// (Same structure as ) pub struct PresenceUpdate { pub user: PublicUser, #[serde(default)] diff --git a/src/types/events/ready.rs b/src/types/events/ready.rs index 4faa95d..ffba526 100644 --- a/src/types/events/ready.rs +++ b/src/types/events/ready.rs @@ -6,13 +6,14 @@ use serde::{Deserialize, Serialize}; use crate::types::entities::{Guild, User}; use crate::types::events::{Session, WebSocketEvent}; -use crate::types::interfaces::ClientStatusObject; -use crate::types::{Activity, GuildMember, PresenceUpdate, VoiceState}; +use crate::types::{Activity, Channel, ClientStatusObject, GuildMember, PresenceUpdate, Snowflake, VoiceState}; #[derive(Debug, Deserialize, Serialize, Default, Clone, WebSocketEvent)] -/// 1/2 half documented; +/// 1/2 officially documented; /// Received after identifying, provides initial user info; -/// See +/// +/// See and +// TODO: There are a LOT of fields missing here pub struct GatewayReady { pub analytics_token: Option, pub auth_session_id_hash: Option, @@ -32,36 +33,47 @@ pub struct GatewayReady { #[derive(Debug, Deserialize, Serialize, Default, Clone, WebSocketEvent)] /// Officially Undocumented; -/// Sent after the READY event when a client is a user, seems to somehow add onto the ready event; +/// Sent after the READY event when a client is a user, +/// seems to somehow add onto the ready event; +/// +/// See pub struct GatewayReadySupplemental { + /// The presences of the user's relationships and guild presences sent at startup pub merged_presences: MergedPresences, pub merged_members: Vec>, - // ? - pub lazy_private_channels: Vec, + pub lazy_private_channels: Vec, pub guilds: Vec, - // ? pomelo + // "Upcoming changes that the client should disclose to the user" (discord.sex) pub disclose: Vec, } #[derive(Debug, Deserialize, Serialize, Default, Clone)] +/// See pub struct MergedPresences { - pub guilds: Vec>, + /// "Presences of the user's guilds in the same order as the guilds array in ready" + /// (discord.sex) + pub guilds: Vec>, + /// "Presences of the user's friends and implicit relationships" (discord.sex) pub friends: Vec, } #[derive(Debug, Deserialize, Serialize, Default, Clone)] +/// Not documented even unofficially pub struct MergedPresenceFriend { - pub user_id: String, + pub user_id: Snowflake, pub status: String, - /// Looks like ms?? - pub last_modified: u128, + // Looks like ms?? + // + // Not always sent + pub last_modified: Option, pub client_status: ClientStatusObject, pub activities: Vec, } #[derive(Debug, Deserialize, Serialize, Default, Clone)] +/// Not documented even unofficially pub struct MergedPresenceGuild { - pub user_id: String, + pub user_id: Snowflake, pub status: String, // ? pub game: Option, @@ -70,8 +82,10 @@ pub struct MergedPresenceGuild { } #[derive(Debug, Deserialize, Serialize, Default, Clone)] +/// See pub struct SupplementalGuild { + pub id: Snowflake, pub voice_states: Option>, - pub id: String, + /// Field not documented even unofficially pub embedded_activities: Vec, }