File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed
src/main/java/net/javadiscord/javabot/systems/qotw/submissions Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change 3434import java .util .Optional ;
3535import java .util .concurrent .CompletableFuture ;
3636import 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 ;
You can’t perform that action at this time.
0 commit comments