Releases: devoxin/Flight
Flight 3.0.0 - Slash Support
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
- Make
command
lowercase for case-insensitive commands.
Flight 2.0.7
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
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
andSubcommandFunction#name
toExecutable
.
Flight 2.0.4
- Allow hiding commands. (
@Command(hidden = true)
)
Flight 2.0.3
- Don't trim argument.
Flight 2.0.2a
- Fixes a minor issue regarding handling of webhook messages.
Flight 2.0.1a
- Switch to
package.name
, becausepackageName
is a JDK9+ thing. Should fix broken Jitpack build.
Flight 2.0.0a
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
.
- This is an executable, but if the invoked command is a subcommand, this can be cast to
Removed
- Removed
CommandRegistry.registerCommands
shortcuts from CommandClient.
Changed
- Renamed
CommandRegistry.registerCommands
toCommandRegistry.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
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.
- Annotate commands with