Skip to content

Commit

Permalink
Add hack to get correct display for async bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan19 committed Nov 30, 2019
1 parent 955b458 commit e249c84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/commands/EmojiPurgeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ private CompletableFuture<Pair<Integer, Integer>> clearReactionsFromChannel(Arra
}));
});
return CompletableFuture.allOf(completedRemovalFutures.toArray(new CompletableFuture[0])).thenCompose(aVoid ->
//Add delete emoji when done
progressMessage.edit(progressMessage.getContent() + "\nDone!").thenCompose(aVoid1 -> StatisticsCommand.addCancelReactToMessage(progressMessage).thenApply(aVoid2 -> new Pair<>(messagesToClear, emojis))));
//Hack to get display to work correctly
progressMessage.edit("Removing " + emojis + " emojis from " + messagesToClear + " messages! " + messagesToClear + "/" + messagesToClear + " (" + df.format((double) messagesToClear / messagesToClear * 100) + "%)" + "\nDone!").thenCompose(aVoid1 -> StatisticsCommand.addCancelReactToMessage(progressMessage).thenApply(aVoid2 -> new Pair<>(messagesToClear, emojis))));
}

/**
Expand Down

0 comments on commit e249c84

Please sign in to comment.