Hey guys, today I have the new and updated Bot API, this adds loads of new features and a lot more.
Things that have changed:
Package 'com.pzg.www' is now 'com.tjplaysnow'
When you create a new bot you will have to do all of this now. This is so it can be independent of Spigot if you want. Spigot version:
Code (Text):
Bot bot = new Bot("[TOKEN]", "[PREFIX]");
bot.setConsoleCommandManager(new CommandSpigotManager(this));
bot.setBotThread(new ThreadSpigot(this));
Independent version:
Code (Text):
Bot bot = new Bot("[TOKEN]", "[PREFIX]");
bot.setConsoleCommandManager(new CommandConsoleManager());
bot.setBotThread(new ThreadHandle());
The old way of commands is deprecated, now instead of implementing Command you should be extending ProgramCommand. The old way will still work for an unforeseen amount of time.
The console command has changed as well, the old way still works, but it is suggested to switch to extending ProgramCommandConsole.
You can change how the bot functions by setting things such as badWordRun, mutedUserRun, or commandRun!
The Bot class is now extending the abstract ProgramBot, if you want to use the api but don't want to use the Bot base you can create your very own base.
The CommandSpigotManager/CommandConsoleManager are extending the abstract ProgramCommandManager class, and you can very easily create a new ProgramThread if you are building the bot to work in another program as a plugin such as Bungee.
The ThreadSpigot/ThreadHandle are extending the abstract ProgramThread class, and you can very easily create a new ProgramThread if you are building the bot to work in another program as a plugin such as Bungee.