Przeglądaj źródła

Add and Parse Emojis struct.

Chris Rhodes 9 lat temu
rodzic
commit
aa4d42199a
2 zmienionych plików z 13 dodań i 0 usunięć
  1. 4 0
      state.go
  2. 9 0
      structs.go

+ 4 - 0
state.go

@@ -43,6 +43,7 @@ func (s *State) GuildAdd(guild *Guild) error {
 			return nil
 		}
 	}
+
 	s.Guilds = append(s.Guilds, *guild)
 	return nil
 }
@@ -59,6 +60,7 @@ func (s *State) GuildRemove(guild *Guild) error {
 			return nil
 		}
 	}
+
 	return errors.New("Guild not found.")
 }
 
@@ -76,6 +78,7 @@ func (s *State) Guild(guildID string) (*Guild, error) {
 			return &g, nil
 		}
 	}
+
 	return nil, errors.New("Guild not found.")
 }
 
@@ -178,6 +181,7 @@ func (s *State) ChannelAdd(channel *Channel) error {
 
 		guild.Channels = append(guild.Channels, *channel)
 	}
+
 	return nil
 }
 

+ 9 - 0
structs.go

@@ -187,6 +187,14 @@ type PermissionOverwrite struct {
 	Allow int    `json:"allow"`
 }
 
+type Emoji struct {
+	Roles         []string `json:"roles"`
+	RequireColons bool     `json:"require_colons"`
+	Name          string   `json:"name"`
+	Managed       bool     `json:"managed"`
+	ID            string   `json:"id"`
+}
+
 // A Guild holds all data related to a specific Discord Guild.  Guilds are also
 // sometimes referred to as Servers in the Discord client.
 type Guild struct {
@@ -202,6 +210,7 @@ type Guild struct {
 	Large          bool         `json:"large"`     // ??
 	JoinedAt       string       `json:"joined_at"` // make this a timestamp
 	Roles          []Role       `json:"roles"`
+	Emojis         []Emoji      `json:"emojis"`
 	Members        []Member     `json:"members"`
 	Presences      []Presence   `json:"presences"`
 	Channels       []Channel    `json:"channels"`