use of io.discloader.discloader.common.start.Options in project DiscLoader by R3alCl0ud.
the class Main method main.
public static void main(String... args) throws IOException, InterruptedException, ExecutionException {
System.setProperty("http.agent", "DiscLoader");
logger.info("Attempting to read config");
String content = "";
if (new File("options.json").exists()) {
Object[] lines = Files.readAllLines(Paths.get("./options.json")).toArray();
for (Object line : lines) content += line;
options = gson.fromJson(content, Options.class);
token = options.auth.token;
logger.info("Finished reading config");
}
DLOptions opt = new DLOptions();
opt.loadMods(options.loadMods);
opt.setToken(token);
opt.setPrefix(options.prefix);
opt.useDefaultCommands(options.defaultCommands);
opt.setDebug(true);
loader = new DiscLoader(opt);
loader.addEventListener(new Listener());
loader.login().exceptionally(ex -> {
logger.severe("Test Failed");
ex.printStackTrace();
System.exit(1);
return null;
});
CommandRegistry.registerCommand(new CommandRunTest(), "runtest");
CommandRegistry.registerCommand(new CommandCreateGuild(), "createguild");
CommandRegistry.registerCommand(new CommandDeleteGuild(), "deleteguild");
}
Aggregations