Skip to content

Releases: devoxin/Flight

Flight 3.0.0 - Slash Support

02 Nov 14:32
e499bc6
Compare
Choose a tag to compare

This version includes support for slash commands. With this addition, there is also support for "hybrid commands", whereby one function can handle both message and slash contexts.

You may view an in-depth changelog here.

Flight 2.0.8

21 May 21:53
Compare
Choose a tag to compare
  • Make command lowercase for case-insensitive commands.

Flight 2.0.7

21 May 09:57
Compare
Choose a tag to compare

Forgot to make a release for 2.0.6, so this includes those changes.

2.0.6

  • Fix snowflake parser

2.0.7

  • Allow passing a thread pool via CommandClientBuilder#setExecutionThreadPool to execute commands on.
    • This should offer better performance/responsiveness of the bot for long-executing commands as they won't block WebSocket threads.

Flight 2.0.5

18 May 23:15
Compare
Choose a tag to compare

Added

  • @Tentative argument annotation.
    • Allows skipping parsing of arguments if an invalid value was passed to them.
  • Annotation documentation

Changed

  • Flight now throws an error if there a command has an ambiguous name.
  • Moved CommandFunction#name and SubcommandFunction#name to Executable.

Flight 2.0.4

16 May 12:45
Compare
Choose a tag to compare
  • Allow hiding commands. (@Command(hidden = true))

Flight 2.0.3

10 May 16:36
Compare
Choose a tag to compare
  • Don't trim argument.

Flight 2.0.2a

06 May 21:53
Compare
Choose a tag to compare
Flight 2.0.2a Pre-release
Pre-release
  • Fixes a minor issue regarding handling of webhook messages.

Flight 2.0.1a

23 Apr 12:29
Compare
Choose a tag to compare
Flight 2.0.1a Pre-release
Pre-release
  • Switch to package.name, because packageName is a JDK9+ thing. Should fix broken Jitpack build.

Flight 2.0.0a

21 Apr 22:36
Compare
Choose a tag to compare
Flight 2.0.0a Pre-release
Pre-release

This update introduces subcommands. While I don't feel like the implementation is a clean one, subcommands do appear to work as per my testing.

The help command has not been updated to support subcommands yet.
Executing a command without specifying a subcommand will invoke the top-level command. To make the top-level command send a list of available subcommands, you can do something like;

@Command
fun mycommand(ctx: Context, subcommand: String?) {
    val cmd = ctx.invokedCommand as CommandFunction

    val sc = buildString {
        for (c in cmd.subcommands.values.toSet()) {
            appendln("${c.name}: ${c.properties.description}")
        }
    }

    if (subcommand != null) {
        ctx.send("`${subcommand}` isn't a valid subcommand. Try one of these:\n$sc")
    } else {
        ctx.send("Available Subcommands:\n$sc")
    }
}

Added

  • Context.invokedCommand.
    • This is an executable, but if the invoked command is a subcommand, this can be cast to SubCommandFunction.
    • The same applies if the invoked command is a top-level command; it can be cast to CommandFunction.

Removed

  • Removed CommandRegistry.registerCommands shortcuts from CommandClient.

Changed

  • Renamed CommandRegistry.registerCommands to CommandRegistry.register.
  • Moved execution stuff to Executable class. This makes it a little more streamlined to execute commands.
  • Command categories are now detected by package name. This behavior can be changed by overriding Cog.name() to return a non-null string.

Flight 1.7.0

20 Apr 22:49
Compare
Choose a tag to compare

A lot of refactoring went into this release. Mostly moving classes and such to the correct package paths, so they make more sense.

Not a whole lot was added, changed, fixed or removed this release, except:

  • Command Cooldowns
    • Annotate commands with @Cooldown to make use of this feature.
    • You can provide custom CooldownProviders if you desire different behavior to the default one, such as storing cooldowns in redis, mongo, etc.