From edd9ee77c611d1693b9cca30034d2475cc457da2 Mon Sep 17 00:00:00 2001 From: RettichLP Date: Sat, 6 Jul 2024 14:28:10 +0200 Subject: [PATCH] Sync application with teamspeak application --- pom.xml | 9 +++------ src/main/java/net/turniptales/discord/Config.java | 4 ++-- .../turniptales/discord/TurnipTalesDiscord.java | 14 +++++++------- .../common/services/ActivitySyncService.java | 4 ++-- src/main/resources/application.properties | 4 +++- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index d40bc20..eb900c4 100644 --- a/pom.xml +++ b/pom.xml @@ -37,12 +37,6 @@ spring-boot-starter-webflux - - org.apache.tomcat.embed - tomcat-embed-core - 10.1.25 - - com.google.code.gson @@ -70,9 +64,12 @@ 1.1.1 + org.projectlombok lombok + 1.18.34 + provided true diff --git a/src/main/java/net/turniptales/discord/Config.java b/src/main/java/net/turniptales/discord/Config.java index 04f5dc5..8b1eba3 100644 --- a/src/main/java/net/turniptales/discord/Config.java +++ b/src/main/java/net/turniptales/discord/Config.java @@ -6,11 +6,11 @@ import net.dv8tion.jda.api.entities.channel.concrete.Category; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel; -import static net.turniptales.discord.TurnipTalesDiscord.turniptalesBot; +import static net.turniptales.discord.TurnipTalesDiscord.discordBot; public class Config { - public static final Guild GUILD = turniptalesBot.getGuildById("1008928645185810463"); + public static final Guild GUILD = discordBot.getGuildById("1008928645185810463"); public static final Member BOT; // channels public static final TextChannel COMMUNITY_TEXT_CHANNEL = GUILD.getTextChannelById("1008929885764472952"); diff --git a/src/main/java/net/turniptales/discord/TurnipTalesDiscord.java b/src/main/java/net/turniptales/discord/TurnipTalesDiscord.java index 20ab60d..89b3929 100644 --- a/src/main/java/net/turniptales/discord/TurnipTalesDiscord.java +++ b/src/main/java/net/turniptales/discord/TurnipTalesDiscord.java @@ -35,7 +35,7 @@ public class TurnipTalesDiscord implements WebMvcConfigurer { public static final ZoneId ZONE_ID = of("Europe/Berlin"); - public static JDA turniptalesBot; + public static JDA discordBot; public static Api api; public static void main(String[] args) { @@ -50,7 +50,7 @@ public static void main(String[] args) { } private static void startDiscordBot() { - turniptalesBot = JDABuilder + discordBot = JDABuilder .createDefault("MTE5MDcxNDY0MzU1MTg5MTQ3OA.GdvTJE.EMI9oOxjzEe-unfAXWPtOKgb2qGtWkqonPq5OY") .disableCache(MEMBER_OVERRIDES, VOICE_STATE) // Disable parts of the cache .setBulkDeleteSplittingEnabled(false) // Enable the bulk delete event @@ -73,12 +73,12 @@ private static void startDiscordBot() { ) .build(); - turniptalesBot + discordBot .upsertCommand("stats", "Deine Statistiken (nicht öffentlich) oder die eines Discord Nutzers (öffentlich)") .addOption(USER, "player", "Discord Nutzer dessen Statistiken angezeigt werden sollen (Discord Nutzer muss sich verknüpft haben)", false) .queue(); - turniptalesBot + discordBot .upsertCommand("umfrage", "Erstellt eine Umfrage") .addOption(STRING, "question", "Frage", true) .addOption(STRING, "description", "Beschreibung", true) @@ -89,16 +89,16 @@ private static void startDiscordBot() { .addOption(STRING, "answer5", "Antwort 5", false) .queue(); - turniptalesBot + discordBot .upsertCommand("ticket", "Erstellt die Nachricht um Tickets zu erstellen") .queue(); - turniptalesBot + discordBot .upsertCommand("verify", "Verifiziert deinen Minecraft Account") .addOption(STRING, "code", "Verifizierungscode", true) .queue(); - turniptalesBot + discordBot .upsertCommand("giveaway", "Lost einen Spieler anhand der Reaktionen einer Nachricht aus") .addOption(STRING, "message", "Nachricht mit den Reaktionen", true) .queue(); diff --git a/src/main/java/net/turniptales/discord/common/services/ActivitySyncService.java b/src/main/java/net/turniptales/discord/common/services/ActivitySyncService.java index b290ad8..cfe9b7b 100644 --- a/src/main/java/net/turniptales/discord/common/services/ActivitySyncService.java +++ b/src/main/java/net/turniptales/discord/common/services/ActivitySyncService.java @@ -10,7 +10,7 @@ import static java.lang.System.currentTimeMillis; import static java.util.concurrent.TimeUnit.MINUTES; import static net.dv8tion.jda.api.entities.Activity.playing; -import static net.turniptales.discord.TurnipTalesDiscord.turniptalesBot; +import static net.turniptales.discord.TurnipTalesDiscord.discordBot; @Log4j2 @Component @@ -26,7 +26,7 @@ public void run() { log.info("Activity synchronising: started"); Activity activity = playing("auf TurnipTales.net"); - turniptalesBot.getPresence().setActivity(activity); + discordBot.getPresence().setActivity(activity); log.info("Activity synchronising: finished in {}ms", currentTimeMillis() - startTime); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 354888b..a0b96f3 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,7 @@ server.port=9000 + server.error.path=/error server.error.whitelabel.enabled=false + spring.main.banner-mode=off -spring.output.ansi.enabled=ALWAYS \ No newline at end of file +spring.output.ansi.enabled=ALWAYS