@@ -41,9 +41,13 @@ type Channels interface {
4141 RemoveAllReactions (channelID snowflake.ID , messageID snowflake.ID , opts ... RequestOpt ) error
4242 RemoveAllReactionsForEmoji (channelID snowflake.ID , messageID snowflake.ID , emoji string , opts ... RequestOpt ) error
4343
44+ // Deprecated: Use GetChannelPins instead
4445 GetPinnedMessages (channelID snowflake.ID , opts ... RequestOpt ) ([]discord.Message , error )
46+
47+ GetChannelPins (channelID snowflake.ID , before snowflake.ID , limit int , opts ... RequestOpt ) (* discord.ChannelPins , error )
4548 PinMessage (channelID snowflake.ID , messageID snowflake.ID , opts ... RequestOpt ) error
4649 UnpinMessage (channelID snowflake.ID , messageID snowflake.ID , opts ... RequestOpt ) error
50+
4751 Follow (channelID snowflake.ID , targetChannelID snowflake.ID , opts ... RequestOpt ) (* discord.FollowedChannel , error )
4852
4953 GetPollAnswerVotes (channelID snowflake.ID , messageID snowflake.ID , answerID int , after snowflake.ID , limit int , opts ... RequestOpt ) ([]discord.User , error )
@@ -206,11 +210,24 @@ func (s *channelImpl) RemoveAllReactionsForEmoji(channelID snowflake.ID, message
206210 return s .client .Do (RemoveAllReactionsForEmoji .Compile (nil , channelID , messageID , emoji ), nil , nil , opts ... )
207211}
208212
213+ // Deprecated: Use GetChannelPins instead
209214func (s * channelImpl ) GetPinnedMessages (channelID snowflake.ID , opts ... RequestOpt ) (messages []discord.Message , err error ) {
210215 err = s .client .Do (GetPinnedMessages .Compile (nil , channelID ), nil , & messages , opts ... )
211216 return
212217}
213218
219+ func (s * channelImpl ) GetChannelPins (channelID snowflake.ID , before snowflake.ID , limit int , opts ... RequestOpt ) (pins * discord.ChannelPins , err error ) {
220+ values := discord.QueryValues {}
221+ if before != 0 {
222+ values ["before" ] = before
223+ }
224+ if limit != 0 {
225+ values ["limit" ] = limit
226+ }
227+ err = s .client .Do (GetChannelPins .Compile (values , channelID ), nil , & pins , opts ... )
228+ return
229+ }
230+
214231func (s * channelImpl ) PinMessage (channelID snowflake.ID , messageID snowflake.ID , opts ... RequestOpt ) error {
215232 return s .client .Do (PinMessage .Compile (nil , channelID , messageID ), nil , nil , opts ... )
216233}
0 commit comments