Fix typos

This commit is contained in:
bitfl0wer 2023-05-27 19:36:07 +02:00
parent a26ded8ab2
commit da9232da0b
No known key found for this signature in database
GPG Key ID: 84BBB60DF895ABF2
2 changed files with 33 additions and 25 deletions

View File

@ -1,14 +1,14 @@
use crate::types::{AuditLogEntry, Emoji, Sticker, GuildMember, RoleObject, GuildScheduledEvent};
use crate::types::entities::{Guild, UnavailableGuild, User};
use crate::types::events::WebSocketEvent;
use chrono::{Utc, DateTime};
use crate::types::{AuditLogEntry, Emoji, GuildMember, GuildScheduledEvent, RoleObject, Sticker};
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use super::PresenceUpdate;
#[derive(Debug, Deserialize, Serialize, Default)]
/// See https://discord.com/developers/docs/topics/gateway-events#guild-create
/// This one is particularly painful, it can be a Guild object with extra field or an unavailbile guild object
/// This one is particularly painful, it can be a Guild object with an extra field or an unavailable guild object
pub struct GuildCreate {
#[serde(flatten)]
pub d: GuildCreateDataOption,
@ -50,7 +50,7 @@ impl WebSocketEvent for GuildBanRemove {}
/// See https://discord.com/developers/docs/topics/gateway-events#guild-update
pub struct GuildUpdate {
#[serde(flatten)]
pub guild: Guild
pub guild: Guild,
}
impl WebSocketEvent for GuildUpdate {}
@ -59,7 +59,7 @@ impl WebSocketEvent for GuildUpdate {}
/// See https://discord.com/developers/docs/topics/gateway-events#guild-delete
pub struct GuildDelete {
#[serde(flatten)]
pub guild: UnavailableGuild
pub guild: UnavailableGuild,
}
impl WebSocketEvent for GuildDelete {}
@ -68,7 +68,7 @@ impl WebSocketEvent for GuildDelete {}
/// See https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create
pub struct GuildAuditLogEntryCreate {
#[serde(flatten)]
pub entry: AuditLogEntry
pub entry: AuditLogEntry,
}
impl WebSocketEvent for GuildAuditLogEntryCreate {}
@ -77,7 +77,7 @@ impl WebSocketEvent for GuildAuditLogEntryCreate {}
/// See https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update
pub struct GuildEmojisUpdate {
pub guild_id: String,
pub emojis: Vec<Emoji>
pub emojis: Vec<Emoji>,
}
impl WebSocketEvent for GuildEmojisUpdate {}
@ -86,7 +86,7 @@ impl WebSocketEvent for GuildEmojisUpdate {}
/// See https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update
pub struct GuildStickersUpdate {
pub guild_id: String,
pub stickers: Vec<Sticker>
pub stickers: Vec<Sticker>,
}
impl WebSocketEvent for GuildStickersUpdate {}
@ -145,7 +145,7 @@ pub struct GuildMembersChunk {
pub chunk_count: u16,
pub not_found: Option<Vec<String>>,
pub presences: Option<PresenceUpdate>,
pub nonce: Option<String>
pub nonce: Option<String>,
}
impl WebSocketEvent for GuildMembersChunk {}

View File

@ -15,7 +15,7 @@ pub struct GatewayIdentifyPayload {
pub presence: Option<PresenceUpdate>,
// What is the difference between these two?
// Intents is documented, capabilities is used in users
// I wonder if these are interchangable..
// I wonder if these are interchangeable...
#[serde(skip_serializing_if = "Option::is_none")]
pub intents: Option<i32>,
#[serde(skip_serializing_if = "Option::is_none")]
@ -31,9 +31,18 @@ impl Default for GatewayIdentifyPayload {
impl GatewayIdentifyPayload {
/// Uses the most common, 25% data along with client capabilities
///
/// Basically pretends to be an official client on windows 10, with chrome 113.0.0.0
/// Basically pretends to be an official client on Windows 10, with Chrome 113.0.0.0
pub fn common() -> Self {
Self { token: "".to_string(), properties: GatewayIdentifyConnectionProps::default(), compress: Some(false), large_threshold: None, shard: None, presence: None, intents: None, capabilities: Some(8189) }
Self {
token: "".to_string(),
properties: GatewayIdentifyConnectionProps::default(),
compress: Some(false),
large_threshold: None,
shard: None,
presence: None,
intents: None,
capabilities: Some(8189),
}
}
}
@ -111,7 +120,6 @@ impl Default for GatewayIdentifyConnectionProps {
}
impl GatewayIdentifyConnectionProps {
/// Returns a minimal, least data possible default
fn minimal() -> Self {
Self {