This is now an old resource, if you were redirected here go ahead and download it but don't use it to create your Discord Bot(s)!
Go here for the new updated version.
http://tjplaysnow.ddns.net/portfolio/minecraft-plugins/Discord-Bot-API/
This is an API to use for making discord bots. You can run this alongside your Minecraft server to make things very 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.
public Bot bot;
public final String TOKEN = "";
public final String PREFIX = "!";
@Override
public void onEnable() {
bot = new bot(TOKEN, PREFIX);
}
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 some basic test commands.
@Override
public void onEnable() {
bot = new Bot(TOKEN, PREFIX);
bot.addCommand(new CommandMessage("test", "Test!"));
bot.addCommand(new CommandMethod("help", Permissions.SEND_MESSAGES.toString(), new Method() {
@Override
public void method(IUser user, IChannel channel, IGuild guild, String label, List<String> args) {
user.getOrCreatePMChannel().sendMessage(
"Commands: \n" +
"- test : A simple test command.\n" +
"- help : The best help command in the world.");
}
}));
}
This will create two commands, one command that when run will send back a message saying "Test!" and another one that will private message the user that sent the command a help list.
Now for when your server shuts down let's add something to turn the bot off. In on disable we are going to add this line of code.
@Override
public void onDisable() {
bot.getBot().logout();
}
Now we want to add words to the bad word filter? Sure can do it's as easy as this one line of code in the onEnable.
@Override
public void onEnable() {
bot = new Bot(TOKEN, PREFIX);
bot.addBadWord("bad");
}
Now you want to know everything about the bot's code and the way it ties into discord get the Discord4j Javadoc and use it as the Bot API's own javadoc.
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!
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta