-
-
Notifications
You must be signed in to change notification settings - Fork 101
Migrate to JDA alpha 20 #587
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a8e87c4
to
db71c7f
Compare
c2ede77
to
861ac15
Compare
Taz03
requested changes
Sep 30, 2022
application/src/main/java/org/togetherjava/tjbot/commands/BotCommandAdapter.java
Show resolved
Hide resolved
Tais993
previously approved these changes
Oct 2, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
861ac15
to
61d33fb
Compare
one approve, one week old, merging |
Kudos, SonarCloud Quality Gate passed! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Closes #586 .
This migrates our JDA dependency from alpha 9 to the latest alpha 20. JDA had several breaking changes that required work on our side. The changes are done in multiple steps (see commits):
9 -> 10
They introduced a new overload for
event.getOption(...)
that accepts a fallback value directly. So instead of checking fornull
, we can provide the fallback directly. Adjusted inRoleSelectCommand
.The max amount of embeds (10) is now a constant, using that instead of hardcoding in
WolframAlphaHandler
.Breaking changes on moderation methods, such as
guild.ban(user)
. Those methods now dont accept a pure ID anymore, but require a proper user object. Fortunately, this was trivial to adjust since we always had those at hand already:TemporaryMuteAction
TemporaryQuarantineAction
10 -> 13
Breaking changes for emojis. They are now not called
Emote
anymore, butEmoji
. And a few minor changes on the API. Biggest changes inSuggestionsUpDownVoter
, mostly just changingEmote
toRichCustomEmoji
and similar. Just some simple renamings.Slash command visibility has now to be set on the command itself, using
setGuildOnly
. Done so directly inBotCommandAdapter
.13 -> 18
Massive breaking changes from 17 to 18. They split the hierarchy of
Message
,MessageBuilder
and everything that belongs to that. Essentially, the class was logically split in 3:Message
MessageCreateAction
MessageEditAction
This change bleeds heavily into a lot of classes. For example, all builders had to be replaced by either
MessageCreateBuilder
orMessageEditBuilder
. But not only that, some classes did both (edit and create) and now had to be properly split (in some cases, generics worked quite fine here).The biggest hit however is the whole
JdaTester
mocking setup for our unit tests. A lot of stuff had to be adjusted there.Also,
ActionRow
was basically inlined toList<Button>
and file uploads likemessage.addFile(data, name)
where replaced with a wrappermessage.addFiles(FileUpload.fromData(data, name))
and a few more subtle, but breaking changes like these here and there.18 -> 19
LoginException
was replaced byInvalidTokenException
.The
guild.ban(...)
andkick(...)
methods have been deprecated to slightly change their usage.ban
now takes aTimeUnit
instead of implicitly always beingTimeUnit.DAYS
andreason
has been moved out to.ban(...).reason(reason)
instead of being directly in theban/kick
call.Apart from that, this change introduces massive noise on the imports. They essentially moved around all
Channel
classes.19 -> 20
No breaking changes for us. This adds
RestAction#onSuccess
, which replaces one ugly.<Void>map(... -> { ... return null;})
occurence 👍Checklist
Details at: https://github.com/DV8FromTheWorld/JDA/releases