1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-30 18:53:30 +00:00

Fixed bug where Guilds state is never populated

This commit is contained in:
diamondburned (Forefront) 2020-01-19 23:13:05 -08:00
parent 1c9b45e051
commit 7261cb2b68

View file

@ -270,6 +270,11 @@ func (s *DefaultStore) Guild(id discord.Snowflake) (*discord.Guild, error) {
func (s *DefaultStore) Guilds() ([]discord.Guild, error) {
s.mut.Lock()
if len(s.guilds) == 0 {
s.mut.Unlock()
return nil, ErrStoreNotFound
}
var gs = make([]discord.Guild, 0, len(s.guilds))
for _, g := range s.guilds {
gs = append(gs, *g)