Skip to content

Commit

Permalink
DiscordMessage: actually use the future from the message
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 21, 2023
1 parent cab9759 commit 8408d44
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public static void autoExecute(ScriptEntry scriptEntry,
}
DiscordConnection connection = bot.getConnection();
JDA client = connection.client;
CompletableFuture<? extends MessageChannel> toChannel = null;
CompletableFuture<? extends MessageChannel> toChannel;
if (reply != null && reply.channel_id != 0) {
toChannel = requireChannel(connection.getChannel(reply.channel_id));
}
Expand Down Expand Up @@ -215,6 +215,6 @@ else if (edit != null) {
else {
return c.sendMessage((MessageCreateData) finalBuilder.build());
}
}).thenAccept(r -> DiscordCommandUtils.mapError(scriptEntry, r).onSuccess((m -> scriptEntry.addObject("message", new DiscordMessageTag(finalBot.bot, m))))));
}).thenApply(r -> DiscordCommandUtils.mapError(scriptEntry, r).onSuccess(m -> scriptEntry.addObject("message", new DiscordMessageTag(finalBot.bot, m))).submit()));
}
}

0 comments on commit 8408d44

Please sign in to comment.