fix that might work or might does nothing or just useless

This commit is contained in:
Chayapak 2023-08-28 16:12:21 +07:00
parent d36aeebc96
commit 2b775ac7e4

View file

@ -130,29 +130,35 @@ public class Main {
public static void initializeBots() { public static void initializeBots() {
alreadyStarted = true; alreadyStarted = true;
Configuration.BotOption[] botsOptions = config.bots; try {
Configuration.BotOption[] botsOptions = config.bots;
// idk if these should be here lol, but it is just the discord stuff // idk if these should be here lol, but it is just the discord stuff
JDA jda = null; JDA jda = null;
if (config.discord.enabled) { if (config.discord.enabled) {
JDABuilder builder = JDABuilder.createDefault(config.discord.token); JDABuilder builder = JDABuilder.createDefault(config.discord.token);
builder.enableIntents(GatewayIntent.MESSAGE_CONTENT); builder.enableIntents(GatewayIntent.MESSAGE_CONTENT);
try { try {
jda = builder.build(); jda = builder.build();
jda.awaitReady(); jda.awaitReady();
} catch (InterruptedException ignored) { } catch (InterruptedException ignored) {
System.exit(1); System.exit(1);
}
jda.getPresence().setPresence(Activity.playing(config.discord.statusMessage), false);
} }
jda.getPresence().setPresence(Activity.playing(config.discord.statusMessage), false);
}
for (Configuration.BotOption botOption : botsOptions) { for (Configuration.BotOption botOption : botsOptions) {
final Bot bot = new Bot(botOption, bots, config); final Bot bot = new Bot(botOption, bots, config);
bots.add(bot); bots.add(bot);
} }
// fard // fard
new ConsolePlugin(bots, config, jda); new ConsolePlugin(bots, config, jda);
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
} }
private static void checkInternet () throws IOException { private static void checkInternet () throws IOException {