Skip to content

Commit

Permalink
Establish Mongo connection before BotCommands
Browse files Browse the repository at this point in the history
  • Loading branch information
srnyx committed Apr 2, 2024
1 parent 1d2bca0 commit 2c17dc9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/src/main/java/xyz/srnyx/lazylibrary/LazyLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public LazyLibrary() {
}
onReady();

// Mongo
final String mongoUrl = settings.fileSettings.mongo;
if (mongoUrl != null) this.mongo = new MagicMongo(mongoUrl, settings.mongoCollections);

// BotCommands
final CommandsBuilder builder = (settings.fileSettings.ownersPrimary == null ? CommandsBuilder.newBuilder() : CommandsBuilder.newBuilder(settings.fileSettings.ownersPrimary))
.textCommandBuilder(textCommands -> textCommands.disableHelpCommand(true));
Expand Down Expand Up @@ -98,10 +102,6 @@ public LazyLibrary() {
settings.builder.accept(builder);
builder.build(jda);

// Mongo
final String mongoUrl = settings.fileSettings.mongo;
if (mongoUrl != null) this.mongo = new MagicMongo(mongoUrl, settings.mongoCollections);

// stop command
new Thread(() -> {
final Scanner scanner = new Scanner(System.in);
Expand Down

0 comments on commit 2c17dc9

Please sign in to comment.