forked from pothtonswer/discordmuffin
Add and Parse Emojis struct.
This commit is contained in:
parent
ed1076361e
commit
aa4d42199a
2 changed files with 13 additions and 0 deletions
4
state.go
4
state.go
|
@ -43,6 +43,7 @@ func (s *State) GuildAdd(guild *Guild) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Guilds = append(s.Guilds, *guild)
|
s.Guilds = append(s.Guilds, *guild)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -59,6 +60,7 @@ func (s *State) GuildRemove(guild *Guild) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors.New("Guild not found.")
|
return errors.New("Guild not found.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,6 +78,7 @@ func (s *State) Guild(guildID string) (*Guild, error) {
|
||||||
return &g, nil
|
return &g, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, errors.New("Guild not found.")
|
return nil, errors.New("Guild not found.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,6 +181,7 @@ func (s *State) ChannelAdd(channel *Channel) error {
|
||||||
|
|
||||||
guild.Channels = append(guild.Channels, *channel)
|
guild.Channels = append(guild.Channels, *channel)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,6 +187,14 @@ type PermissionOverwrite struct {
|
||||||
Allow int `json:"allow"`
|
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
|
// A Guild holds all data related to a specific Discord Guild. Guilds are also
|
||||||
// sometimes referred to as Servers in the Discord client.
|
// sometimes referred to as Servers in the Discord client.
|
||||||
type Guild struct {
|
type Guild struct {
|
||||||
|
@ -202,6 +210,7 @@ type Guild struct {
|
||||||
Large bool `json:"large"` // ??
|
Large bool `json:"large"` // ??
|
||||||
JoinedAt string `json:"joined_at"` // make this a timestamp
|
JoinedAt string `json:"joined_at"` // make this a timestamp
|
||||||
Roles []Role `json:"roles"`
|
Roles []Role `json:"roles"`
|
||||||
|
Emojis []Emoji `json:"emojis"`
|
||||||
Members []Member `json:"members"`
|
Members []Member `json:"members"`
|
||||||
Presences []Presence `json:"presences"`
|
Presences []Presence `json:"presences"`
|
||||||
Channels []Channel `json:"channels"`
|
Channels []Channel `json:"channels"`
|
||||||
|
|
Loading…
Reference in a new issue