[FEAT] Allow Disabling Status Updates
This commit is contained in:
@@ -19,7 +19,7 @@ public class BotConfigSettings {
|
||||
public String botToken = "";
|
||||
|
||||
@Path("statusUpdateInterval")
|
||||
@SpecComment("How often the Bot Status will update on Discord (in Seconds)")
|
||||
@SpecComment("How often the Bot Status will update on Discord (in Seconds). Set to 0 to disable")
|
||||
public int statusUpdateInterval = 30;
|
||||
|
||||
@Path("staffRole")
|
||||
|
||||
@@ -107,6 +107,7 @@ public class BotController {
|
||||
clientBuilder.setOwnerId("354707828298088459");
|
||||
clientBuilder.setHelpWord("help");
|
||||
clientBuilder.useHelpBuilder(false);
|
||||
clientBuilder.setActivity(null);
|
||||
//clientBuilder.forceGuildOnly(750990873311051786L);
|
||||
|
||||
CommandClient commandClient = clientBuilder.build();
|
||||
|
||||
@@ -28,6 +28,7 @@ public class BotReadyHooks {
|
||||
* @param event The {@link ReadyEvent}
|
||||
*/
|
||||
public static void startActivityUpdates(ReadyEvent event) {
|
||||
if (SDLinkConfig.INSTANCE.botConfig.statusUpdateInterval > 0) {
|
||||
BotController.taskManager.scheduleAtFixedRate(() -> {
|
||||
try {
|
||||
if (event.getJDA().getStatus() == JDA.Status.CONNECTED) {
|
||||
@@ -51,6 +52,7 @@ public class BotReadyHooks {
|
||||
}
|
||||
}, SDLinkConfig.INSTANCE.botConfig.statusUpdateInterval, SDLinkConfig.INSTANCE.botConfig.statusUpdateInterval, TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Chat Channel topic, if enabled
|
||||
|
||||
Reference in New Issue
Block a user