Skip to content

Commit 2c17dc9

Browse files
committed
Establish Mongo connection before BotCommands
1 parent 1d2bca0 commit 2c17dc9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/src/main/java/xyz/srnyx/lazylibrary/LazyLibrary.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ public LazyLibrary() {
6767
}
6868
onReady();
6969

70+
// Mongo
71+
final String mongoUrl = settings.fileSettings.mongo;
72+
if (mongoUrl != null) this.mongo = new MagicMongo(mongoUrl, settings.mongoCollections);
73+
7074
// BotCommands
7175
final CommandsBuilder builder = (settings.fileSettings.ownersPrimary == null ? CommandsBuilder.newBuilder() : CommandsBuilder.newBuilder(settings.fileSettings.ownersPrimary))
7276
.textCommandBuilder(textCommands -> textCommands.disableHelpCommand(true));
@@ -98,10 +102,6 @@ public LazyLibrary() {
98102
settings.builder.accept(builder);
99103
builder.build(jda);
100104

101-
// Mongo
102-
final String mongoUrl = settings.fileSettings.mongo;
103-
if (mongoUrl != null) this.mongo = new MagicMongo(mongoUrl, settings.mongoCollections);
104-
105105
// stop command
106106
new Thread(() -> {
107107
final Scanner scanner = new Scanner(System.in);

0 commit comments

Comments
 (0)