Minor gateway updates (#188)

* Fix TYPING_START not existing

* Fix spacebar READY deserialization error
This commit is contained in:
kozabrada123 2023-08-18 12:27:39 +00:00 committed by GitHub
parent a9bbd51c2d
commit ad58b550fb
2 changed files with 4 additions and 3 deletions

View File

@ -628,6 +628,7 @@ impl Gateway {
"STAGE_INSTANCE_CREATE" => stage_instance.create, "STAGE_INSTANCE_CREATE" => stage_instance.create,
"STAGE_INSTANCE_UPDATE" => stage_instance.update, "STAGE_INSTANCE_UPDATE" => stage_instance.update,
"STAGE_INSTANCE_DELETE" => stage_instance.delete, "STAGE_INSTANCE_DELETE" => stage_instance.delete,
"TYPING_START" => user.typing_start,
"USER_UPDATE" => user.update, "USER_UPDATE" => user.update,
"USER_GUILD_SETTINGS_UPDATE" => user.guild_settings_update, "USER_GUILD_SETTINGS_UPDATE" => user.guild_settings_update,
"VOICE_STATE_UPDATE" => voice.state_update, "VOICE_STATE_UPDATE" => voice.state_update,
@ -972,7 +973,7 @@ mod events {
pub update: GatewayEvent<types::UserUpdate>, pub update: GatewayEvent<types::UserUpdate>,
pub guild_settings_update: GatewayEvent<types::UserGuildSettingsUpdate>, pub guild_settings_update: GatewayEvent<types::UserGuildSettingsUpdate>,
pub presence_update: GatewayEvent<types::PresenceUpdate>, pub presence_update: GatewayEvent<types::PresenceUpdate>,
pub typing_start_event: GatewayEvent<types::TypingStartEvent>, pub typing_start: GatewayEvent<types::TypingStartEvent>,
} }
#[derive(Default, Debug)] #[derive(Default, Debug)]

View File

@ -13,7 +13,7 @@ pub struct SessionsReplace {
#[derive(Debug, Deserialize, Serialize, Default, Clone)] #[derive(Debug, Deserialize, Serialize, Default, Clone)]
/// Session info for the current user /// Session info for the current user
pub struct Session { pub struct Session {
pub activities: Vec<Activity>, pub activities: Option<Vec<Activity>>,
pub client_info: ClientInfo, pub client_info: ClientInfo,
pub session_id: String, pub session_id: String,
pub status: String, pub status: String,
@ -24,7 +24,7 @@ pub struct Session {
/// {"client":"web","os":"other","version":0} /// {"client":"web","os":"other","version":0}
// Note: I don't think this one exists yet? Though I might've made a mistake and this might be a duplicate // Note: I don't think this one exists yet? Though I might've made a mistake and this might be a duplicate
pub struct ClientInfo { pub struct ClientInfo {
pub client: String, pub client: Option<String>,
pub os: String, pub os: String,
pub version: u8, pub version: u8,
} }