Skip to content

Commit

Permalink
Fix bug in starboard deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Shea4 committed Jun 23, 2022
1 parent 1d0af50 commit 5972ef0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sx4/src/main/java/com/sx4/bot/handlers/StarboardHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ public void onMessageReactionRemove(MessageReactionRemoveEvent event) {
}

List<Bson> update = List.of(
Operators.set("count", Operators.subtract("$count", 1)),
Operators.set("messageId", Operators.cond(Operators.isEmpty(Operators.filter(config, Operators.gte(Operators.subtract("$count", 1), "$$this.stars"))), Operators.REMOVE, "$messageId"))
Operators.set("messageId", Operators.cond(Operators.isEmpty(Operators.filter(config, Operators.gte(Operators.subtract("$count", 1), "$$this.stars"))), Operators.REMOVE, "$messageId")),
Operators.set("count", Operators.subtract("$count", 1))
);

FindOneAndUpdateOptions options = new FindOneAndUpdateOptions().returnDocument(ReturnDocument.AFTER);
Expand Down

0 comments on commit 5972ef0

Please sign in to comment.