1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-27 09:12:53 +00:00

Compare commits

...

2 commits

4 changed files with 7 additions and 30 deletions

View file

@ -371,7 +371,7 @@ type (
// Undocumented // Undocumented
type ( type (
UserGuildSettingsUpdateEvent struct { UserGuildSettingsUpdateEvent struct {
UserGuildSettings UserGuildSetting
} }
UserSettingsUpdateEvent struct { UserSettingsUpdateEvent struct {
UserSettings UserSettings

View file

@ -118,7 +118,7 @@ type IdentifyProperties struct {
// Optional // Optional
BrowserUserAgent string `json:"browser_user_agent,omitempty"` BrowserUserAgent string `json:"browser_user_agent,omitempty"`
BrowserVersion string `json:"browser_version,omitempty"` BrowserVersion string `json:"browser_version,omitempty"`
OsVersion string `json:"os_version,omitempty"` OSVersion string `json:"os_version,omitempty"`
Referrer string `json:"referrer,omitempty"` Referrer string `json:"referrer,omitempty"`
ReferringDomain string `json:"referring_domain,omitempty"` ReferringDomain string `json:"referring_domain,omitempty"`
} }

View file

@ -22,9 +22,9 @@ type (
// Undocumented fields // Undocumented fields
ReadStates *ReadStates `json:"read_state,omitempty"`
UserSettings *UserSettings `json:"user_settings,omitempty"` UserSettings *UserSettings `json:"user_settings,omitempty"`
UserGuildSettings *UserGuildSettings `json:"user_guild_settings,omitempty"` ReadStates []ReadState `json:"read_state,omitempty"`
UserGuildSettings []UserGuildSetting `json:"user_guild_settings,omitempty"`
Relationships []discord.Relationship `json:"relationships,omitempty"` Relationships []discord.Relationship `json:"relationships,omitempty"`
MergedMembers [][]SupplementalMember `json:"merged_members,omitempty"` MergedMembers [][]SupplementalMember `json:"merged_members,omitempty"`
@ -32,15 +32,7 @@ type (
GeoOrderedRTCRegions []string `json:"geo_ordered_rtc_regions,omitempty"` GeoOrderedRTCRegions []string `json:"geo_ordered_rtc_regions,omitempty"`
} }
// ReadStates is a struct that contains read state entries. It is an // ReadState is a single ReadState entry. It is undocumented.
// undocumented Discord v8 API.
ReadStates struct {
Version int `json:"version"`
Partial bool `json:"partial"`
Entries []ReadState `json:"entries"`
}
// ReadState is a single ReadState entry.
ReadState struct { ReadState struct {
ChannelID discord.ChannelID `json:"id"` ChannelID discord.ChannelID `json:"id"`
LastMessageID discord.MessageID `json:"last_message_id"` LastMessageID discord.MessageID `json:"last_message_id"`
@ -94,19 +86,9 @@ type (
EmojiName string `json:"emoji_name"` EmojiName string `json:"emoji_name"`
} }
// UserGuildSettings stores the settings for all user guilds. It is // UserGuildSetting stores the settings for a single guild. It is
// undocumented. // undocumented.
UserGuildSettings struct { UserGuildSetting struct {
Version int `json:"version"`
Partial bool `json:"partial"`
Entries []UserGuildSettingEntry `json:"entries"`
}
// UserGuildSettingEntry stores the settings for a single guild. It is
// undocumented.
UserGuildSettingEntry struct {
Version int `json:"version"`
GuildID discord.GuildID `json:"guild_id"` GuildID discord.GuildID `json:"guild_id"`
SuppressRoles bool `json:"suppress_roles"` SuppressRoles bool `json:"suppress_roles"`

View file

@ -182,11 +182,6 @@ func startReadLoop(conn *websocket.Conn, eventCh chan<- Event) {
return return
} }
// Check if the error is a normal one:
if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
return
}
// Unusual error; log and exit: // Unusual error; log and exit:
eventCh <- Event{nil, errors.Wrap(err, "WS error")} eventCh <- Event{nil, errors.Wrap(err, "WS error")}
return return