mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-02-08 12:36:58 +00:00
Gateway: Added SESSIONS_REPLACE
This commit is contained in:
parent
e0589785c5
commit
4a1d6ad456
|
@ -125,7 +125,7 @@ type Presence struct {
|
||||||
|
|
||||||
Status Status `json:"status"`
|
Status Status `json:"status"`
|
||||||
ClientStatus struct {
|
ClientStatus struct {
|
||||||
Desktop Status `json:"status,omitempty"`
|
Desktop Status `json:"desktop,omitempty"`
|
||||||
Mobile Status `json:"mobile,omitempty"`
|
Mobile Status `json:"mobile,omitempty"`
|
||||||
Web Status `json:"web,omitempty"`
|
Web Status `json:"web,omitempty"`
|
||||||
} `json:"client_status"`
|
} `json:"client_status"`
|
||||||
|
|
|
@ -140,6 +140,10 @@ type Activity struct {
|
||||||
|
|
||||||
Instance bool `json:"instance,omitempty"`
|
Instance bool `json:"instance,omitempty"`
|
||||||
Flags ActivityFlags `json:"flags,omitempty"`
|
Flags ActivityFlags `json:"flags,omitempty"`
|
||||||
|
|
||||||
|
// Undocumented fields
|
||||||
|
SyncID string `json:"sync_id,omitempty"`
|
||||||
|
SessionID string `json:"session_id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ActivityType uint8
|
type ActivityType uint8
|
||||||
|
|
|
@ -175,6 +175,25 @@ type (
|
||||||
// Clients may only update their game status 5 times per 20 seconds.
|
// Clients may only update their game status 5 times per 20 seconds.
|
||||||
PresenceUpdateEvent discord.Presence
|
PresenceUpdateEvent discord.Presence
|
||||||
PresencesReplaceEvent []discord.Presence
|
PresencesReplaceEvent []discord.Presence
|
||||||
|
|
||||||
|
// SessionsReplaceEvent is an undocumented user event. It's likely used for
|
||||||
|
// current user's presence updates.
|
||||||
|
SessionsReplaceEvent []struct {
|
||||||
|
Status discord.Status `json:"status"`
|
||||||
|
SessionID string `json:"session_id"`
|
||||||
|
|
||||||
|
Game *discord.Activity `json:"game"`
|
||||||
|
Activities []discord.Activity `json:"activities"`
|
||||||
|
|
||||||
|
ClientInfo struct {
|
||||||
|
Version int `json:"version"`
|
||||||
|
OS string `json:"os"`
|
||||||
|
Client string `json:"client"`
|
||||||
|
} `json:"client_info"`
|
||||||
|
|
||||||
|
Active bool `json:"active"`
|
||||||
|
}
|
||||||
|
|
||||||
TypingStartEvent struct {
|
TypingStartEvent struct {
|
||||||
ChannelID discord.Snowflake `json:"channel_id"`
|
ChannelID discord.Snowflake `json:"channel_id"`
|
||||||
UserID discord.Snowflake `json:"user_id"`
|
UserID discord.Snowflake `json:"user_id"`
|
||||||
|
@ -183,6 +202,7 @@ type (
|
||||||
GuildID discord.Snowflake `json:"guild_id,omitempty"`
|
GuildID discord.Snowflake `json:"guild_id,omitempty"`
|
||||||
Member *discord.Member `json:"member,omitempty"`
|
Member *discord.Member `json:"member,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
UserUpdateEvent discord.User
|
UserUpdateEvent discord.User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ var EventCreator = map[string]func() Event{
|
||||||
|
|
||||||
"PRESENCE_UPDATE": func() Event { return new(PresenceUpdateEvent) },
|
"PRESENCE_UPDATE": func() Event { return new(PresenceUpdateEvent) },
|
||||||
"PRESENCES_REPLACE": func() Event { return new(PresencesReplaceEvent) },
|
"PRESENCES_REPLACE": func() Event { return new(PresencesReplaceEvent) },
|
||||||
|
"SESSIONS_REPLACE": func() Event { return new(SessionsReplaceEvent) },
|
||||||
|
|
||||||
"TYPING_START": func() Event { return new(TypingStartEvent) },
|
"TYPING_START": func() Event { return new(TypingStartEvent) },
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue