Minor updates

This commit is contained in:
kozabrada123 2023-08-29 17:49:30 +02:00
parent 98b3d510e4
commit ec2cee58a8
7 changed files with 18 additions and 18 deletions

View File

@ -56,7 +56,7 @@ custom_error! {
/// Supposed to be sent as numbers, though they are sent as string most of the time? /// Supposed to be sent as numbers, though they are sent as string most of the time?
/// ///
/// Also includes errors when initiating a connection and unexpected opcodes /// Also includes errors when initiating a connection and unexpected opcodes
#[derive(PartialEq, Eq, Default)] #[derive(PartialEq, Eq, Default, Clone)]
pub GatewayError pub GatewayError
// Errors we have received from the gateway // Errors we have received from the gateway
#[default] #[default]

View File

@ -21,7 +21,7 @@ pub struct CallCreate {
impl WebSocketEvent for CallCreate {} impl WebSocketEvent for CallCreate {}
#[derive(Debug, Deserialize, Serialize, Default, Clone)] #[derive(Debug, Deserialize, Serialize, Default, Clone, PartialEq, Eq)]
/// Officially Undocumented; /// Officially Undocumented;
/// Updates the client on which calls are ringing, along with a specific call?; /// Updates the client on which calls are ringing, along with a specific call?;
/// ///
@ -38,7 +38,7 @@ pub struct CallUpdate {
impl WebSocketEvent for CallUpdate {} impl WebSocketEvent for CallUpdate {}
#[derive(Debug, Deserialize, Serialize, Default, Clone)] #[derive(Debug, Deserialize, Serialize, Default, Clone, PartialEq, Eq)]
/// Officially Undocumented; /// Officially Undocumented;
/// Deletes a ringing call; /// Deletes a ringing call;
/// Ex: {"t":"CALL_DELETE","s":8,"op":0,"d":{"channel_id":"837609115475771392"}} /// Ex: {"t":"CALL_DELETE","s":8,"op":0,"d":{"channel_id":"837609115475771392"}}
@ -48,7 +48,7 @@ pub struct CallDelete {
impl WebSocketEvent for CallDelete {} impl WebSocketEvent for CallDelete {}
#[derive(Debug, Deserialize, Serialize, Default, Clone)] #[derive(Debug, Deserialize, Serialize, Default, Clone, PartialEq, Eq)]
/// Officially Undocumented; /// Officially Undocumented;
/// See <https://unofficial-discord-docs.vercel.app/gateway/op13>; /// See <https://unofficial-discord-docs.vercel.app/gateway/op13>;
/// ///

View File

@ -2,7 +2,7 @@ use crate::types::events::{PresenceUpdate, WebSocketEvent};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_with::serde_as; use serde_with::serde_as;
#[derive(Debug, Deserialize, Serialize, Clone)] #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct GatewayIdentifyPayload { pub struct GatewayIdentifyPayload {
pub token: String, pub token: String,
pub properties: GatewayIdentifyConnectionProps, pub properties: GatewayIdentifyConnectionProps,
@ -68,7 +68,7 @@ impl GatewayIdentifyPayload {
impl WebSocketEvent for GatewayIdentifyPayload {} impl WebSocketEvent for GatewayIdentifyPayload {}
#[derive(Debug, Deserialize, Serialize, Clone)] #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[serde_as] #[serde_as]
pub struct GatewayIdentifyConnectionProps { pub struct GatewayIdentifyConnectionProps {
/// Almost always sent /// Almost always sent

View File

@ -2,7 +2,7 @@ use crate::types::{events::WebSocketEvent, UserStatus};
use crate::types::{Activity, ClientStatusObject, PublicUser, Snowflake}; use crate::types::{Activity, ClientStatusObject, PublicUser, Snowflake};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize, Default, Clone)] #[derive(Debug, Deserialize, Serialize, Default, Clone, PartialEq, Eq)]
/// Sent by the client to update its status and presence; /// Sent by the client to update its status and presence;
/// See <https://discord.com/developers/docs/topics/gateway-events#update-presence> /// See <https://discord.com/developers/docs/topics/gateway-events#update-presence>
pub struct UpdatePresence { pub struct UpdatePresence {
@ -14,7 +14,7 @@ pub struct UpdatePresence {
pub afk: bool, pub afk: bool,
} }
#[derive(Debug, Deserialize, Serialize, Default, Clone)] #[derive(Debug, Deserialize, Serialize, Default, Clone, PartialEq, Eq)]
/// Received to tell the client that a user updated their presence / status /// Received to tell the client that a user updated their presence / status
/// See <https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields> /// See <https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields>
pub struct PresenceUpdate { pub struct PresenceUpdate {

View File

@ -4,7 +4,7 @@ use crate::types::entities::PublicUser;
use crate::types::events::WebSocketEvent; use crate::types::events::WebSocketEvent;
use crate::types::utils::Snowflake; use crate::types::utils::Snowflake;
#[derive(Debug, Default, Deserialize, Serialize, Clone)] #[derive(Debug, Default, Deserialize, Serialize, Clone, PartialEq, Eq)]
/// See <https://discord.com/developers/docs/topics/gateway-events#user-update>; /// See <https://discord.com/developers/docs/topics/gateway-events#user-update>;
/// Sent to indicate updates to a user object; (name changes, discriminator changes, etc); /// Sent to indicate updates to a user object; (name changes, discriminator changes, etc);
pub struct UserUpdate { pub struct UserUpdate {
@ -14,7 +14,7 @@ pub struct UserUpdate {
impl WebSocketEvent for UserUpdate {} impl WebSocketEvent for UserUpdate {}
#[derive(Debug, Default, Deserialize, Serialize, Clone)] #[derive(Debug, Default, Deserialize, Serialize, Clone, PartialEq, Eq)]
/// Undocumented; /// Undocumented;
/// ///
/// Possibly an update for muted guild / channel settings for the current user; /// Possibly an update for muted guild / channel settings for the current user;
@ -39,7 +39,7 @@ pub struct UserGuildSettingsUpdate {
impl WebSocketEvent for UserGuildSettingsUpdate {} impl WebSocketEvent for UserGuildSettingsUpdate {}
#[derive(Debug, Default, Deserialize, Serialize, Clone)] #[derive(Debug, Default, Deserialize, Serialize, Clone, PartialEq, Eq)]
/// Undocumented; /// Undocumented;
/// ///
/// Received in [UserGuildSettingsUpdate]; /// Received in [UserGuildSettingsUpdate];

View File

@ -3,7 +3,7 @@ use std::net::Ipv4Addr;
use crate::types::WebSocketEvent; use crate::types::WebSocketEvent;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize, Clone)] #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
/// The ready event for the webrtc stream; /// The ready event for the webrtc stream;
/// Used to give info after the identify event; /// Used to give info after the identify event;
/// See https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-websocket-connection-example-voice-ready-payload; /// See https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-websocket-connection-example-voice-ready-payload;

View File

@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
use crate::types::{entities::Emoji, Snowflake}; use crate::types::{entities::Emoji, Snowflake};
#[derive(Debug, Deserialize, Serialize, Clone)] #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct Activity { pub struct Activity {
name: String, name: String,
#[serde(rename = "type")] #[serde(rename = "type")]
@ -22,19 +22,19 @@ pub struct Activity {
buttons: Option<Vec<ActivityButton>>, buttons: Option<Vec<ActivityButton>>,
} }
#[derive(Debug, Deserialize, Serialize, Clone)] #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
struct ActivityTimestamps { struct ActivityTimestamps {
start: Option<i64>, start: Option<i64>,
end: Option<i64>, end: Option<i64>,
} }
#[derive(Debug, Deserialize, Serialize, Clone)] #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
struct ActivityParty { struct ActivityParty {
id: Option<String>, id: Option<String>,
size: Option<Vec<(i32, i32)>>, size: Option<Vec<(i32, i32)>>,
} }
#[derive(Debug, Deserialize, Serialize, Clone)] #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
struct ActivityAssets { struct ActivityAssets {
large_image: Option<String>, large_image: Option<String>,
large_text: Option<String>, large_text: Option<String>,
@ -42,7 +42,7 @@ struct ActivityAssets {
small_text: Option<String>, small_text: Option<String>,
} }
#[derive(Debug, Deserialize, Serialize, Clone)] #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
struct ActivitySecrets { struct ActivitySecrets {
join: Option<String>, join: Option<String>,
spectate: Option<String>, spectate: Option<String>,
@ -50,7 +50,7 @@ struct ActivitySecrets {
match_string: Option<String>, match_string: Option<String>,
} }
#[derive(Debug, Deserialize, Serialize, Clone)] #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
struct ActivityButton { struct ActivityButton {
label: String, label: String,
url: String, url: String,