Skip to content

Commit 406f0fe

Browse files
Merge pull request #379 from Java-Discord/qotw-author-fix
fix QOTW author retrieval
2 parents f48a0c4 + 44b71bf commit 406f0fe

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import lombok.Data;
44
import net.dv8tion.jda.api.entities.User;
55
import net.dv8tion.jda.api.entities.channel.concrete.ThreadChannel;
6+
import net.javadiscord.javabot.util.ExceptionLogger;
67

78
import java.util.function.Consumer;
89

@@ -30,11 +31,9 @@ public void retrieveAuthor(Consumer<User> onSuccess) {
3031
onSuccess.accept(author);
3132
return;
3233
}
33-
thread.retrieveThreadMembers().queue(s -> s.forEach(m -> {
34-
if (author == null && !m.getUser().isBot()) {
35-
author = m.getUser();
36-
onSuccess.accept(author);
37-
}
38-
}));
34+
thread
35+
.getJDA()
36+
.retrieveUserById(thread.getName().split(" - ")[1])
37+
.queue(onSuccess, e -> ExceptionLogger.capture(e, QOTWSubmission.class.getSimpleName()));
3938
}
4039
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DELETE FROM qotw_points WHERE user_id=374328434677121036;

0 commit comments

Comments
 (0)