Skip to content

Commit

Permalink
version changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Strafbefehl committed Oct 13, 2023
1 parent bf6be0c commit 420784a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>rystudio.strafbefehl.vinyl</groupId>
<artifactId>coreunstable</artifactId>
<version>1.0.40-UNSTABLE-R2</version>
<version>1.0.40-UNSTABLE-R3</version>
<packaging>jar</packaging>
<name>Vinyl-Core</name>

Expand Down
18 changes: 8 additions & 10 deletions src/main/java/rystudio/strafbefehl/vinyl/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,42 +163,40 @@ public JDA buildJDA(int shardCount) throws InterruptedException {



public JDA startBot(int shardCount, DefaultShardManagerBuilder builder) throws InterruptedException {
public JDA startBot(int shardCount) throws InterruptedException {
if (running && shardManager != null) {
stopBot();
}
ShardManager shardManager = builder.build();
DefaultShardManagerBuilder builder = DefaultShardManagerBuilder.create(getConfig().getToken(), gatewayIntents);
builder.setEnabledIntents(gatewayIntents);
builder.enableCache(enabledCacheFlags);
builder.disableCache(disabledCacheFlags);
for (int i = 0; i < shardCount; i++) {
builder.setShardsTotal(shardCount);
builder.setShards(i, shardCount - 1);
ShardManager shardManager = builder.build(); // Build the ShardManager instance
jdas.add(shardManager.getShardById(i)); // Add the JDA instance to the list
jdas.get(i).awaitReady().getPresence().setActivity(Activity.listening("Shard: " + String.valueOf(i)));
jdas.get(i).addEventListener(this);
jdas.get(i).addEventListener(slashCommands);
Logger.log(LogType.LISTENERS, jdas.get(i).getRegisteredListeners().toString());

if (this.config != null && this.config.getUsePrefixCommands()) {
jdas.get(i).addEventListener(prefixCommands);
}
}


if (this.config != null && this.config.getUseMysql()) {
try {
this.mysqlInit();
} catch (SQLException e) {
throw new RuntimeException(e);
}
}

millisStart = System.currentTimeMillis();


updateCommands();
logCurrentExecutors();
Logger.log(LogType.OK, "Core (RyStudio) finished loading in " + ConsoleColors.GREEN_BOLD + (System.currentTimeMillis() - millisStart) + "ms" + ConsoleColors.GREEN + ".");

updateStats();


return jdas.get(0);
}

Expand Down

0 comments on commit 420784a

Please sign in to comment.