JDA icon indicating copy to clipboard operation
JDA copied to clipboard

Add missing retrieveMessage methods to ReactionEvents

Open Kaktushose opened this issue 1 year ago • 3 comments

Pull Request Etiquette

Changes

  • [ ] Internal code
  • [x] Library interface (affecting end-user code)
  • [ ] Documentation
  • [ ] Other: _____

Description

Adds a retrieveMessage method to the MessageReactionRemoveAllEvent and MessageReactionRemoveEmojiEvent. While it's just a shortcut for getChannel().retrieveMessageById(getMessageId()) and can therefore be seen as redundant and syntatic sugar, the GenericMessageReactionEvent also has such a method. So this addition makes the API more consistent

Kaktushose avatar Jan 10 '24 15:01 Kaktushose

Wouldn't it be better to move this to the GenericMessageEvent class instead? Seems right now that you are just repeating the same code a few times

duncte123 avatar Jan 11 '24 08:01 duncte123

No, because some subclasses like MessageDeleteEvent couldn't use this method

Kaktushose avatar Jan 11 '24 09:01 Kaktushose

What about adding an interface like GenericMessageReactionRemoveEvent with the common code then?

yoyosource avatar Jul 11 '24 10:07 yoyosource