yagpdb icon indicating copy to clipboard operation
yagpdb copied to clipboard

CC: getChannelPins function

Open mrbentarikau opened this issue 3 years ago • 3 comments

Function getChannelPins will return a slice of pinned message IDs... This is still open for discussion, to return full messages versus only IDs as in this PR and later on use getMessage. Also context function branches are set to alphabetical order.

mrbentarikau avatar Aug 12 '22 19:08 mrbentarikau

(Note: I've already stated this privately — this comment is just for the benefit of possible reviewers considering the problem at hand.)

My thoughts on whether full messages or IDs should be returned: IMO providing direct access to messages is the way to go. Given that the API returns full messages, deliberately transforming the response to just contain IDs seems counterproductive — all it does is add a layer of indirection for users, who will still be able to use getMessage if needed. (Furthermore, if users do end up calling getMessage, we will end up making multiple API calls when one could have sufficed.)

jo3-l avatar Aug 12 '22 19:08 jo3-l

+1 to returning the entire message.

phenpessoa avatar Aug 13 '22 00:08 phenpessoa

with full messages comes another question, returning slice of pointers []*discordgo.Message, or a slice of dereferenced messages... First would take less message space because 50 full sized pinned messages surely will not fit 2K limit.

mrbentarikau avatar Aug 13 '22 00:08 mrbentarikau

changed it to return complete message objects

mrbentarikau avatar Aug 23 '22 13:08 mrbentarikau