Skip to content

Commit c1cbf2e

Browse files
committed
fix unmarshalling into interface in Rest. GetGuildChannels()
1 parent 5e7e7ee commit c1cbf2e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

rest/guilds.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ func (s *guildImpl) GetGuildChannels(guildID snowflake.ID, opts ...RequestOpt) (
118118
if err != nil {
119119
return
120120
}
121-
err = s.client.Do(compiledRoute, nil, &channels, opts...)
121+
var chs []discord.UnmarshalChannel
122+
err = s.client.Do(compiledRoute, nil, &chs, opts...)
123+
if err == nil {
124+
channels = make([]discord.GuildChannel, len(chs))
125+
for i := range chs {
126+
channels[i] = chs[i].Channel.(discord.GuildChannel)
127+
}
128+
}
122129
return
123130
}
124131

0 commit comments

Comments
 (0)