From a4c9c25373c215296ec07fdc6d483483cd5a2a16 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 28 Jul 2021 16:02:13 +0200 Subject: [PATCH] Add SteamwarDiscordBot presence --- src/de/steamwar/bungeecore/bot/SteamwarDiscordBot.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/bot/SteamwarDiscordBot.java b/src/de/steamwar/bungeecore/bot/SteamwarDiscordBot.java index f7ed156..2069424 100644 --- a/src/de/steamwar/bungeecore/bot/SteamwarDiscordBot.java +++ b/src/de/steamwar/bungeecore/bot/SteamwarDiscordBot.java @@ -24,6 +24,8 @@ import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig; import de.steamwar.bungeecore.bot.listeners.RolesInteractionButtonListener; import de.steamwar.bungeecore.bot.util.DiscordRolesMessage; import de.steamwar.bungeecore.bot.util.DiscordRulesMessage; +import de.steamwar.bungeecore.sql.Event; +import de.steamwar.bungeecore.sql.EventFight; import lombok.Getter; import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDABuilder; @@ -185,7 +187,12 @@ public class SteamwarDiscordBot { private void activity() { switch (index) { case 0: - jda.getPresence().setActivity(Activity.playing("SteamWar.de")); + Event event = Event.get(); + if (event != null) { + jda.getPresence().setActivity(Activity.competing("Event - " + event.getEventName())); + } else { + jda.getPresence().setActivity(Activity.playing("SteamWar.de")); + } break; case 1: jda.getPresence().setActivity(Activity.of(Activity.ActivityType.DEFAULT, "Online: " + BungeeCore.get().getProxy().getOnlineCount()));