Releases: devoxin/Flight
Releases · devoxin/Flight
Flight 4.2.0
Fixes
- Map
floattodoubleinternally to supportFloattype parameters in commands for slash commands.
Additions
- Crude support for autocomplete on parameters using
@Autocomplete("nameOfAutocompleteMethod") - Rudimentary support for pre-defined choices on arguments.
- Added
guildOnlyboolean to@SubCommand- This boolean isn't synced with Discord at the time of writing due to limitations with slash commands. Only top-level commands can be flagged as guild-only, so this is implemented as a client-side check.
Changes
- Changed
SlashContext#respond0to always return a value, which carries over to public calling functions. Argument#parameteris now a public field.- Deprecated
BadArgument#originalin favour ofThrowable#cause - Changed
ObjectStorageto extendMutableMapto improve usability. - Changed
RoleParserto allow specifying the@everyonerole without pinging.- Users may write
"everyone"to trigger this behaviour.
- Users may write
Flight 4.1.1
- Fix an issue where subcommand aliases could cause an
IllegalArgumentExceptionwhen trying to update slash commands using the output ofCommandRegistry#toDiscordCommands()
Flight 4.1.0
- Further optimisations to some things.
- Extract
sendPrivateandwaitFormethods out ofMessageContextintoContext. - Add
CommandClient#isCommand(Message)
Flight 4.0.0
Fixes
- Fix erroneous check in
ArgParserwhereby there would always be anIllegalArgumentExceptionfor the error cause.- The logic behind setting the exception cause could never yield true as the requirements were impossible to meet within the enclosing
ifblock. This logic has been simplified to only check for the existence of aStringerror message returned from therangeCheckfunction instead.
- The logic behind setting the exception cause could never yield true as the requirements were impossible to meet within the enclosing
Changes
- Remove the need to wrap returned values in parsers with
Optional.- Instead, you now return the parameter directly, or
null, rather than e.g.Optional.ofNullable(value).
- Instead, you now return the parameter directly, or
Flight 3.0.6
Additions
- Add
withCountsparameter toInvite.resolve. - Add
Invite.resolveAsync.
Changes
- Use JDA's
CustomEmoji.ICON_URLwhen formatting URL inEmoji. - Internal optimisations
- Make use of
*cacheinstances to avoid memory copying operations. - Reduce number of
SnowflakeParsers in memory by storing a single static instance.
- Make use of
- Update JDA dependency to
5.0.0-beta.15.
Flight 3.0.5
- Check
botPermissionsanduserPermissionsfor slash commands too.- This was not previously checked as it was expected that users should configure permissions for slash commands via Discord itself, however this was counter-intuitive as it wasn't immediately obvious that this was the expectation. It also meant that for some users, commands were open to everyone by default (and my personal opinion, the permissions configuration system for slash commands isn't the most straightforward.)
This has not been marked as a major version bump as the intention now is to draw attention to the change in handling so that users can better reinforce commands that should not be accessible by everyone, be it via Discord's permission system, or from the library itself.
Flight 3.0.4
Additions
- Added
Context#respond(FileUpload). - Added
Context#respond(DSLMessageCreateBuilder)- This aims to allow users to create more fleshed-out responses with familiar Kotlin DSL. The custom class also enables building embeds with DSL.
- Added
SlashContext#replyAsync(Modal) - Added
Context#respond(DSLMessageCreateBuilder)
Removals
- Removed
Context#respond(EmbedBuilder)- The signature clashed with the new
Context#respond(DSLMessageCreateBuilder). As the new method offers more functionality, embed was removed in favour of this. However, porting should be trivial as it now becomesctx.respond { embed { ... } }.
- The signature clashed with the new
Improvements
- Improved documentation for
Context.
Misc
- Updated JDA dependency.
Flight 3.0.3
- Added
Context#think- This sends a
Bot is thinking...or typing indicator to signify a long-running operation.
- This sends a
- Added
Context#respond(EmbedBuilder.() -> Unit)for sending embeds in a DSL manner. - Added default value to
SlashContext#deferAsync'sephemeralparameter to match thedefermethod's signature.
Flight 3.0.2
- Add more
Context#respond,MessageContext#send,MessageContext#sendAsyncandMessageContext#sendPrivatemethods.
Flight 3.0.1
- String range support
- NSFW commands are now flagged as such when exported as
SlashCommandData. - Add
Cog#unloadfunction for cleanly closing resources when removing a cog. - Introduce
ObjectStorageto allow for persistent storage within cogs.- Data stored within
ObjectStoragepersists across reloads.
- Data stored within
- Add
CommandRegistry#clear.