Przeglądaj źródła

Because binzy was too lazy.

No seriously, this allows us see if a guild is actually being created
or just being lazy-loaded.
Bruce Marriner 8 lat temu
rodzic
commit
92c27c7712
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      state.go
  2. 1 1
      structs.go

+ 1 - 1
state.go

@@ -66,7 +66,7 @@ func (s *State) GuildAdd(guild *Guild) error {
 	for i, g := range s.Guilds {
 		if g.ID == guild.ID {
 			// If this guild already exists with data, don't stomp on props
-			if !g.Unavailable {
+			if g.Unavailable != nil && !*g.Unavailable {
 				guild.Members = g.Members
 				guild.Presences = g.Presences
 				guild.Channels = g.Channels

+ 1 - 1
structs.go

@@ -178,7 +178,7 @@ type Guild struct {
 	Presences         []*Presence       `json:"presences"`
 	Channels          []*Channel        `json:"channels"`
 	VoiceStates       []*VoiceState     `json:"voice_states"`
-	Unavailable       bool              `json:"unavailable"`
+	Unavailable       *bool             `json:"unavailable"`
 }
 
 // A GuildParams stores all the data needed to update discord guild settings