Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Sync application with teamspeak application
Browse files Browse the repository at this point in the history
  • Loading branch information
rettichlp committed Jul 6, 2024
1 parent c48ea35 commit edd9ee7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
9 changes: 3 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>

<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>10.1.25</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down Expand Up @@ -70,9 +64,12 @@
<version>1.1.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/turniptales/discord/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/net/turniptales/discord/TurnipTalesDiscord.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -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
spring.output.ansi.enabled=ALWAYS

0 comments on commit edd9ee7

Please sign in to comment.