-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- use own fork to fix pr Top-gg-Community/java-sdk#18 - update stats for all shards on startup - use callback to log errors and success
- Loading branch information
1 parent
dfa5932
commit e7038ab
Showing
5 changed files
with
81 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/net/robinfriedli/aiode/boot/tasks/UpdateTopGGStatsTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package net.robinfriedli.aiode.boot.tasks; | ||
|
||
import java.util.Objects; | ||
|
||
import net.dv8tion.jda.api.JDA; | ||
import net.robinfriedli.aiode.boot.StartupTask; | ||
import net.robinfriedli.aiode.boot.configurations.TopGGComponent; | ||
import net.robinfriedli.aiode.entities.xml.StartupTaskContribution; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class UpdateTopGGStatsTask implements StartupTask { | ||
|
||
private final StartupTaskContribution contribution; | ||
private final TopGGComponent topGGComponent; | ||
|
||
public UpdateTopGGStatsTask(StartupTaskContribution contribution, TopGGComponent topGGComponent) { | ||
this.contribution = contribution; | ||
this.topGGComponent = topGGComponent; | ||
} | ||
|
||
@Override | ||
public void perform(@Nullable JDA shard) throws Exception { | ||
topGGComponent.updateStatsForShard(Objects.requireNonNull(shard)); | ||
} | ||
|
||
@Override | ||
public StartupTaskContribution getContribution() { | ||
return contribution; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters