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
type (
UserGuildSettingsUpdateEvent struct {
UserGuildSettings
UserGuildSetting
}
UserSettingsUpdateEvent struct {
UserSettings

View file

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

View file

@ -22,9 +22,9 @@ type (
// Undocumented fields
ReadStates *ReadStates `json:"read_state,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"`
MergedMembers [][]SupplementalMember `json:"merged_members,omitempty"`
@ -32,15 +32,7 @@ type (
GeoOrderedRTCRegions []string `json:"geo_ordered_rtc_regions,omitempty"`
}
// ReadStates is a struct that contains read state entries. It is an
// 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 is a single ReadState entry. It is undocumented.
ReadState struct {
ChannelID discord.ChannelID `json:"id"`
LastMessageID discord.MessageID `json:"last_message_id"`
@ -94,19 +86,9 @@ type (
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.
UserGuildSettings 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"`
UserGuildSetting struct {
GuildID discord.GuildID `json:"guild_id"`
SuppressRoles bool `json:"suppress_roles"`

View file

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