From aa4d42199a40feaef7f9bda2181eb6327937ebd4 Mon Sep 17 00:00:00 2001 From: Chris Rhodes Date: Sun, 3 Jan 2016 00:38:34 -0800 Subject: [PATCH] Add and Parse Emojis struct. --- state.go | 4 ++++ structs.go | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/state.go b/state.go index 88b30f5..bcc170b 100644 --- a/state.go +++ b/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 } diff --git a/structs.go b/structs.go index bc7df1d..67f827e 100644 --- a/structs.go +++ b/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"`