Skip to content

Commit

Permalink
fix unmarshalling into interface in Rest. GetGuildChannels()
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Jul 22, 2022
1 parent 5e7e7ee commit c1cbf2e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rest/guilds.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,14 @@ func (s *guildImpl) GetGuildChannels(guildID snowflake.ID, opts ...RequestOpt) (
if err != nil {
return
}
err = s.client.Do(compiledRoute, nil, &channels, opts...)
var chs []discord.UnmarshalChannel
err = s.client.Do(compiledRoute, nil, &chs, opts...)
if err == nil {
channels = make([]discord.GuildChannel, len(chs))
for i := range chs {
channels[i] = chs[i].Channel.(discord.GuildChannel)
}
}
return
}

Expand Down

0 comments on commit c1cbf2e

Please sign in to comment.