Skip to content

Releases: devoxin/Flight

Flight 4.2.0

17 Feb 16:57
Compare
Choose a tag to compare

Fixes

  • Map float to double internally to support Float 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 of Throwable#cause
  • Changed ObjectStorage to extend MutableMap to improve usability.
  • Changed RoleParser to allow specifying the @everyone role without pinging.
    • Users may write "everyone" to trigger this behaviour.

Flight 4.1.1

27 Jan 00:18
Compare
Choose a tag to compare
  • Fix an issue where subcommand aliases could cause an IllegalArgumentException when trying to update slash commands using the output of CommandRegistry#toDiscordCommands()

Flight 4.1.0

26 Jan 21:37
Compare
Choose a tag to compare
  • Further optimisations to some things.
  • Extract sendPrivate and waitFor methods out of MessageContext into Context.
  • Add CommandClient#isCommand(Message)

Flight 4.0.0

18 Nov 23:04
Compare
Choose a tag to compare

Fixes

  • Fix erroneous check in ArgParser whereby there would always be an IllegalArgumentException 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 a String error message returned from the rangeCheck function instead.

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).

Flight 3.0.6

18 Nov 22:59
Compare
Choose a tag to compare

Additions

  • Add withCounts parameter to Invite.resolve.
  • Add Invite.resolveAsync.

Changes

  • Use JDA's CustomEmoji.ICON_URL when formatting URL in Emoji.
  • Internal optimisations
    • Make use of *cache instances to avoid memory copying operations.
    • Reduce number of SnowflakeParsers in memory by storing a single static instance.
  • Update JDA dependency to 5.0.0-beta.15.

Flight 3.0.5

21 Jul 19:18
Compare
Choose a tag to compare
  • Check botPermissions and userPermissions 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

20 Jul 17:36
Compare
Choose a tag to compare

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 becomes ctx.respond { embed { ... } }.

Improvements

  • Improved documentation for Context.

Misc

  • Updated JDA dependency.

Flight 3.0.3

15 Jul 22:53
Compare
Choose a tag to compare
  • Added Context#think
    • This sends a Bot is thinking... or typing indicator to signify a long-running operation.
  • Added Context#respond(EmbedBuilder.() -> Unit) for sending embeds in a DSL manner.
  • Added default value to SlashContext#deferAsync's ephemeral parameter to match the defer method's signature.

Flight 3.0.2

24 Jan 22:21
Compare
Choose a tag to compare
  • Add more Context#respond, MessageContext#send, MessageContext#sendAsync and MessageContext#sendPrivate methods.

Flight 3.0.1

24 Jan 20:26
Compare
Choose a tag to compare
  • 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.
  • Add CommandRegistry#clear.