From 7b9d9f7853b3a8cc2e89d1f8c35858f2f0196e1d Mon Sep 17 00:00:00 2001 From: Xujiayao Date: Fri, 5 Jul 2024 01:52:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20status=20->=20act?= =?UTF-8?q?ivity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Relates to #95 --- src/main/java/com/xujiayao/discord_mc_chat/Config.java | 4 ++-- .../java/com/xujiayao/discord_mc_chat/utils/Utils.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/xujiayao/discord_mc_chat/Config.java b/src/main/java/com/xujiayao/discord_mc_chat/Config.java index 3609e81f..9d0c45c8 100644 --- a/src/main/java/com/xujiayao/discord_mc_chat/Config.java +++ b/src/main/java/com/xujiayao/discord_mc_chat/Config.java @@ -23,8 +23,8 @@ public static class Generic { public String language = "en_us"; public String botToken = ""; - public String botPlayingStatus = "Minecraft (%onlinePlayerCount%/%maxPlayerCount%)"; - public String botListeningStatus = ""; + public String botPlayingActivity = "Minecraft (%onlinePlayerCount%/%maxPlayerCount%)"; + public String botListeningActivity = ""; public boolean useWebhook = true; diff --git a/src/main/java/com/xujiayao/discord_mc_chat/utils/Utils.java b/src/main/java/com/xujiayao/discord_mc_chat/utils/Utils.java index 124d33b5..f9be192b 100644 --- a/src/main/java/com/xujiayao/discord_mc_chat/utils/Utils.java +++ b/src/main/java/com/xujiayao/discord_mc_chat/utils/Utils.java @@ -522,12 +522,12 @@ public static void setBotActivity() { // Bot is registered before official server start return; } - if (!CONFIG.generic.botPlayingStatus.isEmpty()) { - JDA.getPresence().setActivity(Activity.playing(CONFIG.generic.botPlayingStatus + if (!CONFIG.generic.botPlayingActivity.isEmpty()) { + JDA.getPresence().setActivity(Activity.playing(CONFIG.generic.botPlayingActivity .replace("%onlinePlayerCount%", Integer.toString(SERVER.getPlayerCount())) .replace("%maxPlayerCount%", Integer.toString(SERVER.getMaxPlayers())))); - } else if (!CONFIG.generic.botListeningStatus.isEmpty()) { - JDA.getPresence().setActivity(Activity.listening(CONFIG.generic.botListeningStatus + } else if (!CONFIG.generic.botListeningActivity.isEmpty()) { + JDA.getPresence().setActivity(Activity.listening(CONFIG.generic.botListeningActivity .replace("%onlinePlayerCount%", Integer.toString(SERVER.getPlayerCount())) .replace("%maxPlayerCount%", Integer.toString(SERVER.getMaxPlayers())))); } else {