startBot()

This commit is contained in:
GregTCLTK 2019-10-31 19:51:13 +01:00
parent ca2ea80ed6
commit b1061cd877

View file

@ -4,6 +4,7 @@ import com.bbn.hadder.commands.general.*;
import com.bbn.hadder.commands.fun.GifCommand; import com.bbn.hadder.commands.fun.GifCommand;
import com.bbn.hadder.commands.misc.GitHubCommand; import com.bbn.hadder.commands.misc.GitHubCommand;
import com.bbn.hadder.commands.moderation.*; import com.bbn.hadder.commands.moderation.*;
import com.bbn.hadder.commands.owner.RebootCommand;
import com.bbn.hadder.commands.owner.ShutdownCommand; import com.bbn.hadder.commands.owner.ShutdownCommand;
import com.bbn.hadder.commands.settings.PrefixCommand; import com.bbn.hadder.commands.settings.PrefixCommand;
import com.bbn.hadder.core.CommandHandler; import com.bbn.hadder.core.CommandHandler;
@ -23,7 +24,10 @@ import java.util.List;
public class Hadder { public class Hadder {
public static void main(String[] args) { public static void main(String[] args) {
startBot();
}
public static void startBot() {
File configfile = new File("./config.json"); File configfile = new File("./config.json");
if (!configfile.exists()) { if (!configfile.exists()) {
System.err.println("No Config File Found!"); System.err.println("No Config File Found!");
@ -46,7 +50,7 @@ public class Hadder {
builder.setToken(config.getString("Token")); builder.setToken(config.getString("Token"));
CommandHandler.cmdlist.addAll(List.of(new TestCommand(), new BanCommand(), new PrefixCommand(), new ShutdownCommand(), new KickCommand(), new PingCommand(), new GifCommand(), new ClearCommand(), new GitHubCommand())); CommandHandler.cmdlist.addAll(List.of(new TestCommand(), new BanCommand(), new PrefixCommand(), new ShutdownCommand(), new KickCommand(), new PingCommand(), new GifCommand(), new ClearCommand(), new GitHubCommand(), new RebootCommand()));
builder.addEventListeners( builder.addEventListeners(
new MentionListener(), new MentionListener(),
@ -60,7 +64,5 @@ public class Hadder {
} catch (LoginException e) { } catch (LoginException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }