Skip to content

Commit db6fd4b

Browse files
committed
fix QOTW author retrieval
1 parent f48a0c4 commit db6fd4b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 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,6 @@ 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.getJDA().retrieveUserById(thread.getName().split(" - ")[1]).queue(onSuccess, e-> ExceptionLogger.capture(e, QOTWSubmission.class.getSimpleName()));
3935
}
4036
}

0 commit comments

Comments
 (0)