Skip to content

Commit 70ca147

Browse files
fix checkstyle
1 parent c7c470e commit 70ca147

File tree

6 files changed

+22
-9
lines changed

6 files changed

+22
-9
lines changed

src/main/java/net/javadiscord/javabot/systems/notification/QOTWNotificationService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import javax.annotation.Nonnull;
1616
import java.time.Instant;
17-
import java.util.concurrent.ExecutorService;
1817

1918
/**
2019
* An extension of {@link QOTWGuildNotificationService} which also handles user qotw

src/main/java/net/javadiscord/javabot/systems/qotw/QOTWCloseSubmissionsJob.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@
2323
import org.jetbrains.annotations.NotNull;
2424
import org.springframework.scheduling.annotation.Scheduled;
2525
import org.springframework.stereotype.Service;
26-
import org.springframework.util.StringUtils;
2726

28-
import javax.swing.text.html.Option;
2927
import java.sql.SQLException;
30-
import java.time.OffsetDateTime;
3128
import java.util.Collections;
3229
import java.util.List;
3330
import java.util.Optional;

src/main/java/net/javadiscord/javabot/systems/qotw/QOTWReminderJob.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77
import net.javadiscord.javabot.systems.notification.NotificationService;
88
import net.javadiscord.javabot.systems.qotw.dao.QuestionQueueRepository;
99
import net.javadiscord.javabot.systems.qotw.model.QOTWQuestion;
10-
import net.javadiscord.javabot.util.ExceptionLogger;
1110
import org.springframework.scheduling.annotation.Scheduled;
1211
import org.springframework.stereotype.Service;
1312

1413
import lombok.RequiredArgsConstructor;
1514

16-
import java.sql.Connection;
1715
import java.sql.SQLException;
1816
import java.util.Optional;
1917

src/main/java/net/javadiscord/javabot/systems/qotw/model/QOTWSubmission.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
import java.util.function.Consumer;
88

9+
/**
10+
* Simple data class that represents a single {@link ThreadChannel submission} and the corresponding
11+
* {@link User author}.
12+
*/
913
@Data
1014
public class QOTWSubmission {
1115
private final ThreadChannel thread;
@@ -15,6 +19,12 @@ public boolean hasAuthor() {
1519
return author != null;
1620
}
1721

22+
/**
23+
* Attempts to retrieve the thread's actual author. Since the bot is creating submission threads, we can't use
24+
* {@link ThreadChannel#getOwnerThreadMember()}, so we just filter all bot-users instead.
25+
*
26+
* @param onSuccess The success-{@link Consumer} for this operation.
27+
*/
1828
public void retrieveAuthor(Consumer<User> onSuccess) {
1929
thread.retrieveThreadMembers().queue(s -> s.forEach(m -> {
2030
if (author == null && !m.getUser().isBot()) {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
package net.javadiscord.javabot.systems.qotw.submissions;
22

3+
/**
4+
* Represents a submissions' status.
5+
*/
36
public enum SubmissionStatus {
7+
/**
8+
* The submission got accepted and was among the best answers for the current week.
9+
*/
410
ACCEPT_BEST,
11+
/**
12+
* The submission simply got accepted.
13+
*/
514
ACCEPT,
15+
/**
16+
* The submission got declined.
17+
*/
618
DECLINE
719
}

src/main/java/net/javadiscord/javabot/systems/qotw/submissions/subcommands/QOTWReviewSubcommand.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package net.javadiscord.javabot.systems.qotw.submissions.subcommands;
22

3-
import net.dv8tion.jda.api.entities.ThreadMember;
4-
import net.dv8tion.jda.api.entities.User;
53
import net.dv8tion.jda.api.entities.channel.ChannelType;
64
import net.dv8tion.jda.api.entities.channel.concrete.ThreadChannel;
75
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
@@ -20,7 +18,6 @@
2018
import org.jetbrains.annotations.NotNull;
2119
import xyz.dynxsty.dih4jda.interactions.commands.application.SlashCommand;
2220

23-
import java.util.Optional;
2421
import java.util.concurrent.ExecutorService;
2522

2623
/**

0 commit comments

Comments
 (0)