Archiviert
1
0

Add SteamwarDiscordBot rich presence

Dieser Commit ist enthalten in:
yoyosource 2021-07-28 15:14:14 +02:00
Ursprung f6e6c191a7
Commit 6a036808d5

Datei anzeigen

@ -31,6 +31,7 @@ import net.dv8tion.jda.api.entities.Activity;
import net.dv8tion.jda.api.entities.ActivityFlag; import net.dv8tion.jda.api.entities.ActivityFlag;
import net.dv8tion.jda.api.entities.RichPresence; import net.dv8tion.jda.api.entities.RichPresence;
import net.dv8tion.jda.api.hooks.ListenerAdapter; import net.dv8tion.jda.api.hooks.ListenerAdapter;
import net.dv8tion.jda.internal.entities.RichPresenceImpl;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -51,16 +52,7 @@ public class SteamwarDiscordBot {
public SteamwarDiscordBot() { public SteamwarDiscordBot() {
INSTANCE = this; INSTANCE = this;
JDABuilder builder = JDABuilder.createDefault(SteamwarDiscordBotConfig.TOKEN); JDABuilder builder = JDABuilder.createDefault(SteamwarDiscordBotConfig.TOKEN);
builder.setActivity(new Activity() { builder.setActivity(new RichPresence() {
@Override
public boolean isRich() {
return true;
}
@Nullable
@Override
public RichPresence asRichPresence() {
return new RichPresence() {
@Override @Override
public long getApplicationIdLong() { public long getApplicationIdLong() {
return 0; return 0;
@ -97,19 +89,19 @@ public class SteamwarDiscordBot {
@Nullable @Nullable
@Override @Override
public String getState() { public String getState() {
return "Test"; return "SteamWar";
} }
@Nullable @Nullable
@Override @Override
public String getDetails() { public String getDetails() {
return "Test"; return "SteamWar";
} }
@Nullable @Nullable
@Override @Override
public Party getParty() { public Party getParty() {
return new Party("", 0, 1); return new Party("", 0, 0);
} }
@Nullable @Nullable
@ -126,7 +118,7 @@ public class SteamwarDiscordBot {
@Override @Override
public boolean isRich() { public boolean isRich() {
return false; return true;
} }
@Nullable @Nullable
@ -150,41 +142,9 @@ public class SteamwarDiscordBot {
@NotNull @NotNull
@Override @Override
public ActivityType getType() { public ActivityType getType() {
return ActivityType.DEFAULT;
}
@Nullable
@Override
public Timestamps getTimestamps() {
return null; return null;
} }
@Nullable
@Override
public Emoji getEmoji() {
return null;
}
};
}
@NotNull
@Override
public String getName() {
return "SteamWar";
}
@Nullable
@Override
public String getUrl() {
return null;
}
@NotNull
@Override
public ActivityType getType() {
return ActivityType.DEFAULT;
}
@Nullable @Nullable
@Override @Override
public Timestamps getTimestamps() { public Timestamps getTimestamps() {