Discord Bot API - JDA 5.1

A simple discord bot creation API.

  1. TJPlaysNow
    Tested Minecraft Versions:
    • 1.7
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    • 1.17
    Source Code:
    https://github.com/TJPlaysNow/Discord-Bot-API---JDA
    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!

Recent Updates

  1. bug fixes
  2. Discord Command Update
  3. JDA Update

Recent Reviews

  1. GalaxyEaterGR
    GalaxyEaterGR
    5/5,
    Version: 5.1
    I like this API a lot, i used it a couple of times. Although i would love to see a maven repository in the future. Keep it up !
    1. TJPlaysNow
      Author's Response
      Thanks man! I have no clue how maven works though so I doubt I will be able to do that sadly.
  2. Skriptix
    Skriptix
    5/5,
    Version: 4.0
    Am I getting something wrong here or am I doing the right thing? I ask for help c: This API is very, very helpful for Discord Bots and Minecraft servers :) Here is the error log: https://pastebin.com/pYQRjbES
    1. TJPlaysNow
      Author's Response
      Thanks for the review!
      Try with the new updates. Sorry about the delays.

      If you have any other questions join the discord and let me know in the spigot channel.
  3. xFatix
    xFatix
    3/5,
    Version: 4.0
    The API is very nice and works fine and fast. I would love to see some docs where i can find maybe some examples for events and commands. And some of the new discord features would be cool too like the new buttons or the / commands :)
    1. TJPlaysNow
      Author's Response
      Hey, their are all the things you will need on github. A comprehensive tutorial in the Wiki section. And Javadocs linked in the readme file.

      https://github.com/TJPlaysNow/Discord-Bot-API---JDA

      Thanks for the review, and if you have more questions ask away on discord!
  4. WeAllLikeCake
    WeAllLikeCake
    5/5,
    Version: 3.0
    Extremely versatile API that allows for the merging of your Discord Bot and server.
  5. dxcf
    dxcf
    5/5,
    Version: 3.0
    it would be great if you have maven for it lol
    ------------------------------------------------
  6. mohmedXM
    mohmedXM
    5/5,
    Version: 3.0
    100% work, it's work in beerspigot and paperspigot taco spigot etc..
    just change
    bot.setBotThread(new ThreadSpigot(plugin));
    to
    bot.setBotThread(new ThreadHandle());
    and
    bot.setConsoleCommandManager(new CommandSpigotManager());
    to
    bot.setConsoleCommandManager(new CommandConsoleManager());
    good luck!
    1. TJPlaysNow
      Author's Response
  7. Cedric..01
    Cedric..01
    5/5,
    Version: 3.0
    very good api ==================================================================
  8. ala89
    ala89
    1/5,
    Version: 2.8
    Hosting a Discord bot on a server Minecraft by pretending that they must be bound is the silliest thing I've ever heard about and any developer would tell you the same thing. Moreover, the API is totally non-flexible bad designed.
    1. TJPlaysNow
      Author's Response
      The bot api is for making bots like this possible https://www.spigotmc.org/resources/discord-minecraft-hook.44095/. Also the API is pretty much 100% flexible, you can literally rewrite everything about it. Sorry you don't believe in the idea of hosting a discord bot on a Minecraft server. It makes for an easy setup discord bot for Minecraft Discord communication, and if you'd rather you can just use it as an api for non minecraft purposes, just make a main method and make sure you extract the jars into your build when you build.
  9. KingzlyHCF
    KingzlyHCF
    3/5,
    Version: 2.8
    I love love lovee this plugin, but there is no errors and it is not running on PaperSpigot 1.8.8 :(
    1. TJPlaysNow
      Author's Response
      Hmm, that is strange. I'm glad you love the plugin! Try and send errors to the discord server or on the discussion tab first.
  10. MrBaguette07
    MrBaguette07
    3/5,
    Version: 2.8
    Hello, I'm sorry for these stars, but I could not test your API, it does not work on my network in 1.12.2, maybe there is a compatible version in 1.12.2?
    1. TJPlaysNow
      Author's Response
      What about it does not work? Have you setup another plugin that uses the api?