@@ -129,9 +129,9 @@ public void handleSelectReview(StringSelectInteractionEvent event, String thread
129129 final QOTWSubmission submission = new QOTWSubmission (submissionThread );
130130 submission .retrieveAuthor (author -> {
131131 switch (status ) {
132- case ACCEPT_BEST -> acceptSubmission (submissionThread , author , true );
133- case ACCEPT -> acceptSubmission (submissionThread , author , false );
134- default -> declineSubmission (submissionThread , author , status );
132+ case ACCEPT_BEST -> acceptSubmission (submissionThread , author , event . getMember (), true );
133+ case ACCEPT -> acceptSubmission (submissionThread , author , event . getMember (), false );
134+ default -> declineSubmission (submissionThread , author , event . getMember (), status );
135135 }
136136 if (config .getSubmissionChannel ().getThreadChannels ().size () <= 1 ) {
137137 Optional <ThreadChannel > newestPostOptional = config .getSubmissionsForumChannel ().getThreadChannels ()
@@ -185,17 +185,18 @@ private boolean canCreateSubmissions(Member member) {
185185 *
186186 * @param thread The submission's {@link ThreadChannel}.
187187 * @param author The submissions' author.
188+ * @param reviewedBy The reviewer.
188189 * @param bestAnswer Whether the submission is among the best answers for this week.
189190 */
190- public void acceptSubmission (@ NotNull ThreadChannel thread , @ NotNull User author , boolean bestAnswer ) {
191+ public void acceptSubmission (@ NotNull ThreadChannel thread , @ NotNull User author , Member reviewedBy , boolean bestAnswer ) {
191192 thread .getManager ().setName (SUBMISSION_ACCEPTED + thread .getName ().substring (1 )).queue ();
192193 pointsService .increment (author .getIdLong ());
193194 notificationService .withQOTW (thread .getGuild (), author ).sendAccountIncrementedNotification ();
194195 if (bestAnswer ) {
195196 pointsService .increment (author .getIdLong ());
196197 notificationService .withQOTW (thread .getGuild (), author ).sendBestAnswerNotification ();
197198 }
198- notificationService .withQOTW (thread .getGuild ()).sendSubmissionActionNotification (author , new QOTWSubmission (thread ), bestAnswer ? SubmissionStatus .ACCEPT_BEST : SubmissionStatus .ACCEPT );
199+ notificationService .withQOTW (thread .getGuild ()).sendSubmissionActionNotification (reviewedBy . getUser () , new QOTWSubmission (thread ), bestAnswer ? SubmissionStatus .ACCEPT_BEST : SubmissionStatus .ACCEPT );
199200 Optional <ThreadChannel > newestPostOptional = config .getSubmissionsForumChannel ().getThreadChannels ()
200201 .stream ().max (Comparator .comparing (ThreadChannel ::getTimeCreated ));
201202 if (newestPostOptional .isPresent ()) {
@@ -225,12 +226,13 @@ public void acceptSubmission(@NotNull ThreadChannel thread, @NotNull User author
225226 *
226227 * @param thread The submission's {@link ThreadChannel}.
227228 * @param author The submissions' author.
229+ * @param reviewedBy The reviewer
228230 * @param status The {@link SubmissionStatus}.
229231 */
230- public void declineSubmission (@ NotNull ThreadChannel thread , User author , SubmissionStatus status ) {
232+ public void declineSubmission (@ NotNull ThreadChannel thread , User author , Member reviewedBy , SubmissionStatus status ) {
231233 thread .getManager ().setName (SUBMISSION_DECLINED + thread .getName ().substring (1 )).queue ();
232234 notificationService .withQOTW (thread .getGuild (), author ).sendSubmissionDeclinedEmbed (status );
233- notificationService .withQOTW (thread .getGuild ()).sendSubmissionActionNotification (author , new QOTWSubmission (thread ), status );
235+ notificationService .withQOTW (thread .getGuild ()).sendSubmissionActionNotification (reviewedBy . getUser () , new QOTWSubmission (thread ), status );
234236 thread .getManager ().setLocked (true ).setArchived (true ).queue ();
235237 }
236238
0 commit comments