Fix: the reaction isn't added

Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
Louis Vallat 2021-04-16 16:28:31 +02:00
parent 0375911c67
commit 09be3c9959

View File

@ -68,7 +68,7 @@ public final class DiscordManager {
.getReactors(r).any(user -> user.equals(discordClient.getSelf().block())).block())
&& Objects.requireNonNull(event.getMessage().block()).getAuthor().isPresent()
&& !Objects.requireNonNull(event.getMessage().block()).getAuthor().get().equals(discordClient.getSelf().block()))
.flatMap(event -> event.getMessage().flatMap(message -> message.addReaction(reactionAnswers[new Random().nextInt(reactionAnswers.length)])))
.flatMap(event -> event.getMessage().flatMap(message -> message.addReaction(reactionAnswers[new Random().nextInt(reactionAnswers.length)])).then())
.subscribe();
}