Discord Bot Base is a base for creating discord bots in Java with Discord4J API
- Download and import the project on your IDE
- Create a new bot on Discord Developer Portal.
- Go to the Main.java class and modify the name of the bot, the prefix, the token, the owner id
- Now you can run the bot
- Go to the package 'fr.endwiz.bot.base.commands' and create a new class
- Extands your class of 'BaseCmd'
- Write
public yourClass() {
super(CmdCategory.{category}, CmdPermission.{perm}, Arrays.asList(Names Commands)), aliases;
}
@Override
public void execute(Context context) {
{action}
}
- Go to CmdManager.java and add your class commands on the constructor
Classic Message:
channel.createMessage("Pong!").block();
Embed Message:
channel.createEmbed(spec ->
spec.setColor(Color.RED)
.setAuthor("setAuthor", URL, IMAGE_URL)
.setImage(IMAGE_URL)
.setTitle("setTitle/setUrl")
.setUrl(ANY_URL)
.setDescription("setDescription\n" +
"big D: is setImage\n" +
"small D: is setThumbnail\n" +
"<-- setColor")
.addField("addField", "inline = true", true)
.addField("addFIeld", "inline = true", true)
.addField("addFile", "inline = false", false)
.setThumbnail(IMAGE_URL)
.setFooter("setFooter --> setTimestamp", IMAGE_URL)
.setTimestamp(Instant.now())
).block();
Add reaction:
channel.createMessage("Pong!").block().addReaction(ReactionEmoji.unicode("✅")).block();
If you need help, you can send me a private message on my Twitter (English and French only). You can also go to the Github or Discord of Discord4J for more help!