Archiviert
1
0

Add SteamwarDiscordBot presence

Dieser Commit ist enthalten in:
yoyosource 2021-07-28 16:02:13 +02:00
Ursprung 2bfc37ae84
Commit a4c9c25373

Datei anzeigen

@ -24,6 +24,8 @@ import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import de.steamwar.bungeecore.bot.listeners.RolesInteractionButtonListener; import de.steamwar.bungeecore.bot.listeners.RolesInteractionButtonListener;
import de.steamwar.bungeecore.bot.util.DiscordRolesMessage; import de.steamwar.bungeecore.bot.util.DiscordRolesMessage;
import de.steamwar.bungeecore.bot.util.DiscordRulesMessage; import de.steamwar.bungeecore.bot.util.DiscordRulesMessage;
import de.steamwar.bungeecore.sql.Event;
import de.steamwar.bungeecore.sql.EventFight;
import lombok.Getter; import lombok.Getter;
import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.JDABuilder; import net.dv8tion.jda.api.JDABuilder;
@ -185,7 +187,12 @@ public class SteamwarDiscordBot {
private void activity() { private void activity() {
switch (index) { switch (index) {
case 0: 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; break;
case 1: case 1:
jda.getPresence().setActivity(Activity.of(Activity.ActivityType.DEFAULT, "Online: " + BungeeCore.get().getProxy().getOnlineCount())); jda.getPresence().setActivity(Activity.of(Activity.ActivityType.DEFAULT, "Online: " + BungeeCore.get().getProxy().getOnlineCount()));