Discord Bot API - JDA icon

Discord Bot API - JDA -----

A simple discord bot creation API.



This is an API to use for making discord bots. You can run this alongside your Minecraft server to make making a discord bot super simple.

If you are not a developer and weren't redirected here this is probably not for you.

To start using this API you need to create a Bot.
Code (Text):
public Bot bot;
public final String TOKEN = "[Insert Token Here]";

@Override
public void onEnable() {
    bot = new Bot(TOKEN);
    bot.setBotThread(new ThreadSpigot(plugin));
    bot.setConsoleCommandManager(new CommandSpigotManager());
}
There are several things to do with this. If you don't have a Discord Bot ready to use you need to go to this link and make one.
In order to make one you must click New App, fill out the information for how you'd like it. Now that you have an app created we want to specify to Discord that it is a Bot, click the button that says "Create Bot User". Now click the reveal token button, copy that token into the final string named TOKEN.

Now let's add it to your Discord server. Go back to the page you just had opened and copy the client id. Now add it to the end of this link and go there, you will want to select your server and give it the permissions.
https://discordapp.com/oauth2/authorize?permissions=2146958579&scope=bot&client_id=

Now lets create a command for the bot. You will need to go back to your main class and in the onEnable like before we will add a basic test command.
Code (Text):
bot.addCommand(new ProgramCommand() {
    @Override
    public boolean run(User user, MessageChannel channel, Guild guild, String label, List<String> args) {
        channel.sendMessage("Pong!").complete();
        return false;
    }
 
    @Override
    public Permission getPermissionNeeded() {
        return Permission.MESSAGE_WRITE;
    }
 
    @Override
    public String getLabel() {
        return "Ping";
    }
 
    @Override
    public String getDescription() {
        return "A ping pong command to test connection.";
    }
});
This command will send a message "pong" when the command "ping" is received.

There are some basic commands already made for you. To enable them do this after registering your bot.
Code (Text):
bot.addCommand(new HelpCommand());
bot.addCommand(new MuteCommand());
bot.addCommand(new UnmuteCommand());
For further information check out the JavaDocs:
(Coming Soon)


Join my discord!
Give me a spare dollar to keep me making great plugins!

Please don't rate it bad due to a bug, talk to me about it first!
Resource Information
Author:
----------
Total Downloads: 21,640
First Release: Nov 19, 2017
Last Update: Jul 21, 2022
Category: ---------------
All-Time Rating:
25 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings