This command library was built to help people make amazing bots within JDA!
It uses maven for dependency management because I am an XML fanboy,
but I also find gradle cool and use it for some projects.
Thank you for the amazing people at JDA for inspiring the creation of this library,
go and check them out at https://github.com/DV8FromTheWorld/JDA/
This is a command which echoes the input of the user if their sentence begins with the bot's prefix and echo
, repeat
or copy
.
If the input was bot, echo hello!
the output would be hello!
(If the prefix was bot,
)
@CommandDescription(name = "Echo", triggers = {"echo", "repeat", "copy"},
description = "This command echoes what you say!",
args = 1)
public class Echo implements Command {
@Override
public void execute(Message message, String args) {
message.getChannel().sendMessage(args).queue();
}
}
For more detailed examples please see the example repository
here.
Examples marked with a * may not be suitable for beginners.
- List outdated, coming soon.
The current promoted version is 1.1.0
<!--Repository for JDA-Command-->
<repository>
<id>jitpack.io</id>
<name>jitpack</name>
<url>https://jitpack.io</url>
</repository>
<!--Repository for JDA-->
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
<!--Dependency for JDA-Command-->
<dependency>
<groupId>com.github.Comportment</groupId>
<artifactId>JDA-Command</artifactId>
<version>1.1.0</version>
</dependency>
<!--Dependency for JDA-->
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>3.2.0_242</version>
</dependency>
repositories {
//This repository is needed for JDA.
jcenter()
//Make sure this repository is last.
maven { url 'https://jitpack.io' }
}
dependencies {
//JDA-Command dependency
compile 'com.github.Comportment:JDA-Command:1.1.0'
//JDA dependency
compile group: 'net.dv8tion', name: 'JDA', version: '3.2.0_242'
}