Skip to content

Commit

Permalink
ne
Browse files Browse the repository at this point in the history
  • Loading branch information
burdoto committed Apr 24, 2024
1 parent 01a8bba commit 061ddab
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,17 @@ public DiscordModule(Server server, DiscordModulePrototype proto) {
super(server, proto);
this.adapter = Optional.ofNullable(proto.getDiscordBot())
.map(DiscordAdapter::get)
.orElseThrow();
.orElse(null);
}

@Override
@SneakyThrows
protected void $initialize() {
if (adapter == null) {
log.warning("Cannot initialize "+this+"; adapter not loaded");
return;
}

var chat = events.getBus();

adapter.getJda().awaitReady();
Expand Down

0 comments on commit 061ddab

Please sign in to comment.