-
Notifications
You must be signed in to change notification settings - Fork 91
Common ReactionEvent interface #1011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Added an interface for ReactionAddEvent and ReactionRemoveEvent to remove code duplication and allow better Generics
For some reason I can't approve this PR for the CI, but you need to run |
Is it a binary incompatible change to move functions to a parent class? |
I don't think so, but just to make sure, what do you mean by that? |
that code compiled against a previous version will continue to work and it is a change since the function signature changes, in this case there should be a deprecated version on the class, however that will make migrating kinda hard /cc @lukellmann |
Actually now that I think about it, I think the signatures would change since they're linked to the interface now but still are actually linked to the class somehow? Would they be the same as before if the methods would just be overriding the interface's instead? |
Nah prvsly it was called |
no, it isn't |
core/src/commonMain/kotlin/event/message/ReactionRemoveEvent.kt
Outdated
Show resolved
Hide resolved
the signature does not include the class the method is in |
why did I belive AI |
Hi? This was kinda left out idk |
I added an interface for
ReactionAddEvent
andReactionRemoveEvent
to remove code duplication and allow better GenericsThing is, in one of my projects, I ended up doing a class for both of them because they're not bound by anything I could use as generic.
So basically, with that PR I'm grouping both Reaction events classes together to make things easier with an
interface
Also I removed what I thought was unnecessary to keep after since both
ReactionAddEvent
andReactionRemoveEvent
had very similar codePretty simple, but efficient hopefully!