Support user guild settings update event.
This commit is contained in:
parent
50b7bdd6ff
commit
f58410afa4
2 changed files with 50 additions and 27 deletions
|
@ -37,6 +37,7 @@ var eventToInterface = map[string]interface{}{
|
|||
"READY": Ready{},
|
||||
"USER_UPDATE": UserUpdate{},
|
||||
"USER_SETTINGS_UPDATE": UserSettingsUpdate{},
|
||||
"USER_GUILD_SETTINGS_UPDATE": UserGuildSettingsUpdate{},
|
||||
"TYPING_START": TypingStart{},
|
||||
"VOICE_SERVER_UPDATE": VoiceServerUpdate{},
|
||||
"VOICE_STATE_UPDATE": VoiceStateUpdate{},
|
||||
|
@ -140,3 +141,8 @@ type UserUpdate struct {
|
|||
|
||||
// UserSettingsUpdate is a map for an event.
|
||||
type UserSettingsUpdate map[string]interface{}
|
||||
|
||||
// UserGuildSettingsUpdate is a map for an event.
|
||||
type UserGuildSettingsUpdate struct {
|
||||
*UserGuildSettings
|
||||
}
|
||||
|
|
17
structs.go
17
structs.go
|
@ -331,6 +331,23 @@ type GuildEmojisUpdate struct {
|
|||
Emojis []*Emoji `json:"emojis"`
|
||||
}
|
||||
|
||||
// A UserGuildSettingsChannelOverride stores data for a channel override for a users guild settings.
|
||||
type UserGuildSettingsChannelOverride struct {
|
||||
Muted bool `json:"muted"`
|
||||
MessageNotifications int `json:"message_notifications"`
|
||||
ChannelID string `json:"channel_id"`
|
||||
}
|
||||
|
||||
// A UserGuildSettings stores data for a users guild settings.
|
||||
type UserGuildSettings struct {
|
||||
SupressEveryone bool `json:"suppress_everyone"`
|
||||
Muted bool `json:"muted"`
|
||||
MobilePush bool `json:"mobile_push"`
|
||||
MessageNotifications int `json:"message_notifications"`
|
||||
GuildID string `json:"guild_id"`
|
||||
ChannelOverrides []*UserGuildSettingsChannelOverride `json:"channel_overrides"`
|
||||
}
|
||||
|
||||
// A State contains the current known state.
|
||||
// As discord sends this in a READY blob, it seems reasonable to simply
|
||||
// use that struct as the data store.
|
||||
|
|
Loading…
Reference in a new issue