Releases: devoxin/Flight
Releases · devoxin/Flight
Flight 4.2.0
Fixes
- Map
float
todouble
internally to supportFloat
type 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
guildOnly
boolean 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#respond0
to always return a value, which carries over to public calling functions. Argument#parameter
is now a public field.- Deprecated
BadArgument#original
in favour ofThrowable#cause
- Changed
ObjectStorage
to extendMutableMap
to improve usability. - Changed
RoleParser
to allow specifying the@everyone
role 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
IllegalArgumentException
when trying to update slash commands using the output ofCommandRegistry#toDiscordCommands()
Flight 4.1.0
- Further optimisations to some things.
- Extract
sendPrivate
andwaitFor
methods out ofMessageContext
intoContext
. - Add
CommandClient#isCommand(Message)
Flight 4.0.0
Fixes
- Fix erroneous check in
ArgParser
whereby there would always be anIllegalArgumentException
for the error cause.- The logic behind setting the exception cause could never yield true as the requirements were impossible to meet within the enclosing
if
block. This logic has been simplified to only check for the existence of aString
error message returned from therangeCheck
function 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
withCounts
parameter toInvite.resolve
. - Add
Invite.resolveAsync
.
Changes
- Use JDA's
CustomEmoji.ICON_URL
when formatting URL inEmoji
. - Internal optimisations
- Make use of
*cache
instances to avoid memory copying operations. - Reduce number of
SnowflakeParser
s 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
botPermissions
anduserPermissions
for 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
'sephemeral
parameter to match thedefer
method's signature.
Flight 3.0.2
- Add more
Context#respond
,MessageContext#send
,MessageContext#sendAsync
andMessageContext#sendPrivate
methods.
Flight 3.0.1
- String range support
- NSFW commands are now flagged as such when exported as
SlashCommandData
. - Add
Cog#unload
function for cleanly closing resources when removing a cog. - Introduce
ObjectStorage
to allow for persistent storage within cogs.- Data stored within
ObjectStorage
persists across reloads.
- Data stored within
- Add
CommandRegistry#clear
.