Skip to content

Releases: S3nS3IW00/JCommands

JCommands v8.0.0

06 Jan 19:27
e6ae978
Compare
Choose a tag to compare

The update contains major changes (backward incompatible API changes)!

Changelog

  • Fix argument indentification in autocompletes (#22)
  • Handle limitations of options (unique name and SubArgument-InputArgument mixing in the same scope)
  • Limit concatenation to InputArguments
  • Add action listener to SubArgument
    • Only results after the SubArgument included in the event
    • All of the registered listeners in the same scope get triggered, command's listener is the last
    • The first triggered listener that has a response will respond to the command, all other responders will be ignored

Usage

Maven

<dependency>    
    <groupId>io.github.s3ns3iw00</groupId>    
    <artifactId>jcommands</artifactId>    
    <version>8.0.0</version>    
</dependency>    

Gradle

dependencies {    
    implementation 'io.github.s3ns3iw00.jcommands:8.0.0'    
}    

If you not familiar with these build tools, you can download the jar file below and use it as dependency in your project, but instead it is recommended to use a build tool.

JCommands v7.0.1

21 Jul 07:12
Compare
Choose a tag to compare

This release contains only a hotfix for an NPE that occured when a command had multiple subcommands and it tried to find the not used one. (2cdc9d9)

Usage

Maven

<dependency>    
    <groupId>io.github.s3ns3iw00</groupId>    
    <artifactId>jcommands</artifactId>    
    <version>7.0.1</version>    
</dependency>    

Gradle

dependencies {    
    implementation 'io.github.s3ns3iw00.jcommands:7.0.1'    
}    

If you not familiar with these build tools, you can download the jar file below and use it as dependency in your project, but instead it is recommended to use a build tool.

JCommands v7.0.0

12 May 09:50
eea7bad
Compare
Choose a tag to compare

The update contains major changes (backward incompatible API changes)!

Changelog

  • Generify concatenator and add converter to it
  • Change concatenator API
    • Concatenator now only gets a list of values from ArgumentResult that contains the value stored in the optional in case of optional arguments instead of the optional type itself. Optional arguments that have not been specified get removed from the list.

Usage

The repository is now on Maven Central, so it is recommended to switch from JitPack.

Maven

<dependency>    
    <groupId>io.github.s3ns3iw00</groupId>    
    <artifactId>jcommands</artifactId>    
    <version>7.0.0</version>    
</dependency>    

Gradle

dependencies {    
    implementation 'io.github.s3ns3iw00.jcommands:7.0.0'    
}    

If you not familiar with these build tools, you can download the jar file below and use it as dependency in your project, but instead it is recommended to use a build tool.

JCommands v6.0.0

04 Apr 11:05
7802752
Compare
Choose a tag to compare

Introduction to generics, new argument validation, new argument conversion, remove input value storage in arguments and more...

Changelog

JCommands now uses Javacord v3.8.0 (latest)

  • Generics
    • Arguments now have input and output generic type
    • Argument validation and conversion uses generic to determine the type of the input and output
  • Deprecations
    • Classes and methods that have been marked as deprecated in the previous version are now removed completely
    • Autocompletable interface is now deprecated, instead of there is an abstract AutocompletableInputArgument class that is an extension of InputArgument
    • Optionality interface is now deprecated, InputArgument and its extensions can be marked as optional by default.
    • The method to specify argument mismatch event in arguments now deprecated, it has been replaced with a new validation system
    • ValueArgument is now deprecated, instead the new regex validation can be used on arguments with String input type to validate the input by a regex pattern
  • Modifications
    • ComboArgument is now an InputArgument
    • Commands now can be age-restricted (NSFW)
    • Inputs now does not get stored in the arguments (I know that this was not made any sense, and it also was buggy)
    • The regex validation of command's and argument's name has been updated according to Discord docs
    • StringArgument and NumberArgument are the only arguments that are autocompletable
    • Converter now belongs to one argument not globally to every argument with matching input and output type, that means when the argument has different output type than input type, a converter has to specified in the argument directly to be able to convert the input to the output type.
  • New argument validation
    • InputArgument's input value can be validated with predicates
    • Arguments with String input type can be validated by regex pattern with RegexPredicate validation
    • StringLengthPredicate to validate length of Strings and NumberPredicate to validate numbers

As always, a detailed explanation of the features can be found on the wiki page.

Usage

The repository is now on Maven Central, so it is recommended to switch from JitPack.

Maven

<dependency>    
    <groupId>io.github.s3ns3iw00</groupId>    
    <artifactId>jcommands</artifactId>    
    <version>6.0.0</version>    
</dependency>    

Gradle

dependencies {    
    implementation 'io.github.s3ns3iw00.jcommands:6.0.0'    
}    

If you not familiar with these build tools, you can download the jar file below and use it as dependency in your project, but instead it is recommended to use a build tool.

JCommands v5.0.0

09 Mar 20:58
ea0e184
Compare
Choose a tag to compare

Changelog

  • SlashCommand, SlashCommandBuilder, and old permission system marked as deprecated
  • Modal respond added to CommandResponder
  • Implemented Discord's new permission system
  • Added ServerCommand and GlobalCommand as default commands
    • Command's initial permissions can be set
    • GlobalCommand can be enabled in DMs
    • New builders
  • Ephemeral added to late response
  • Added support for Attachment arguments (AttachmentArgument)
    • Size and file extension can be limited
  • Return optional arguments as an Optional in the action listener

Usage

  1. Download
    • Jar file below
    • Clone repository
    git clone https://github.com/S3nS3IW00/JCommands.git  
    
  2. Initiate the listener
    CommandHandler.setApi(DiscordApi);  
  3. Give a star if you like it and enjoy!

JCommands v4.2.0

01 Mar 14:32
e2db7ab
Compare
Choose a tag to compare

New features

  • Implement autocomplete with three different type
    • Regular autocomplete with static choices
    • Conditional autocomplete with choices based on the custom condition
    • Search autocomplete that asks for a datasource and operates like a search bar
  • Introduce a new type for storing the current state of the autocompleting operation, like
    • Command
    • User
    • Channel
    • Current argument
    • All, already specified arguments and its values
  • Introduce new type for storing choices of combo argument and autocomplete
  • Implement a new interface for identifying arguments that can be autocompleted
  • Add support for DECIMAL option type

Edits

  • ServerCommand and ServerCommandBuilder classes have been renamed to SlashCommand and SlashCommandBuilder
  • Combo argument is no longer an input argument
  • Combo argument now returns a Choice instead of the value, that contains the key and the value.
  • Implement optionalnity interface for identifying arguments that can be optional

Bugfix

  • Fix converting integer to long in combo argument

JCommands v4.1.1

20 Feb 19:12
086dba8
Compare
Choose a tag to compare

Update to Javacord v3.4.0:

  • Implement API changes
  • Change integer option type to long

JCommands v4.1.0

08 Jan 11:34
03aa841
Compare
Choose a tag to compare

More information about the changes can be found here.

JCommands v4.0.2

16 Dec 12:10
e3dd0df
Compare
Choose a tag to compare

JCommands v4.0.1

15 Dec 12:46
Compare
Choose a tag to compare
  • Fixed limitations

Limitations were stored in they own interface. Since interfaces can contains only public static final fields, limitations were applied for every command

  • Added new limitation to builder
  • Added generic type to SubArgument to be able to add an abstract method that need to have a generic parameter that can be anything that extends Argument class