Skip to content

Commit

Permalink
fix activity
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkGoosik committed Jul 23, 2023
1 parent d556dc8 commit 18443d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/main/java/ru/pinkgoosik/kitsun/Bot.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,20 @@ public static void init() throws InterruptedException {
System.exit(0);
}

JDA jda = JDABuilder.createDefault(token)
var jda = JDABuilder.createDefault(token)
.addEventListeners((EventListener) event -> {
if(event instanceof ReadyEvent readyEvent) {
DiscordEventsListener.onConnect(readyEvent);
}
})
.addEventListeners(new DiscordEventsListener())
.enableIntents(Arrays.asList(GatewayIntent.values())).setActivity(Activity.playing(secrets.get().activity))
.build();
.enableIntents(Arrays.asList(GatewayIntent.values()));

jda.awaitReady();
if(!secrets.get().activity.isBlank()) {
jda.setActivity(Activity.playing(secrets.get().activity));
}

jda.build().awaitReady();
}

public static Guild getGuild(String id) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/ru/pinkgoosik/kitsun/schedule/Scheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ public static void start() {
timer.schedule(new TimerTask() {
@Override
public void run() {
KitsunDebugger.CACHE.clear();
MCUpdatesScheduler.schedule();
}
}, 0, 10 * (60 * 1000));
}, 0, 5 * (60 * 1000));

timer.schedule(new TimerTask() {
@Override
Expand Down

0 comments on commit 18443d0

Please sign in to comment.