Skip to content

Commit 6e06164

Browse files
Removed some unecessary stuff
1 parent 45876f8 commit 6e06164

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/main/java/net/javadiscord/javabot/systems/qotw/submissions/SubmissionManager.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import java.util.Optional;
3535
import java.util.concurrent.CompletableFuture;
3636
import java.util.concurrent.ExecutorService;
37-
import java.util.function.Consumer;
3837

3938
/**
4039
* Handles & manages QOTW Submissions by using Discords {@link ThreadChannel}s.
@@ -113,24 +112,13 @@ public List<QOTWSubmission> getActiveSubmissions() {
113112
public void handleThreadDeletion(@NotNull ButtonInteractionEvent event) {
114113
if (event.getChannelType() != ChannelType.GUILD_PRIVATE_THREAD) return;
115114
ThreadChannel thread = event.getChannel().asThreadChannel();
116-
getOrRetrieveAuthor(new QOTWSubmission(thread), author -> {
115+
new QOTWSubmission(thread).retrieveAuthor(author -> {
117116
if (event.getUser().getIdLong() == author.getIdLong()) {
118117
thread.delete().queue();
119118
}
120119
});
121120
}
122121

123-
private void getOrRetrieveAuthor(@NotNull QOTWSubmission submission, Consumer<User> onSuccess) {
124-
if (submission.hasAuthor()) {
125-
onSuccess.accept(submission.getAuthor());
126-
} else {
127-
submission.retrieveAuthor(author -> {
128-
submission.setAuthor(author);
129-
onSuccess.accept(author);
130-
});
131-
}
132-
}
133-
134122
private boolean canCreateSubmissions(Member member) {
135123
if (member == null) return false;
136124
if (member.getUser().isBot() || member.getUser().isSystem()) return false;

0 commit comments

Comments
 (0)