forked from Fascinated/Bat
more embed cleanup
This commit is contained in:
parent
0d1eb3089a
commit
519cb72c14
@ -16,7 +16,7 @@ public class EmbedUtils {
|
||||
*
|
||||
* @return the embed builder
|
||||
*/
|
||||
public static EmbedBuilder buildGenericEmbed() {
|
||||
public static EmbedBuilder genericEmbed() {
|
||||
return new EmbedBuilder()
|
||||
.setTimestamp(LocalDateTime.now())
|
||||
.setColor(Colors.DEFAULT);
|
||||
@ -27,7 +27,7 @@ public class EmbedUtils {
|
||||
*
|
||||
* @return the embed builder
|
||||
*/
|
||||
public static EmbedBuilder buildErrorEmbed() {
|
||||
public static EmbedBuilder errorEmbed() {
|
||||
return new EmbedBuilder()
|
||||
.setTimestamp(LocalDateTime.now())
|
||||
.setColor(Colors.ERROR);
|
||||
@ -38,7 +38,7 @@ public class EmbedUtils {
|
||||
*
|
||||
* @return the embed builder
|
||||
*/
|
||||
public static EmbedBuilder buildSuccessEmbed() {
|
||||
public static EmbedBuilder successEmbed() {
|
||||
return new EmbedBuilder()
|
||||
.setTimestamp(LocalDateTime.now())
|
||||
.setColor(Colors.SUCCESS);
|
||||
|
@ -7,7 +7,6 @@ import cc.fascinated.bat.model.BatGuild;
|
||||
import cc.fascinated.bat.model.BatUser;
|
||||
import cc.fascinated.bat.service.GuildService;
|
||||
import lombok.NonNull;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.Role;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
@ -32,7 +31,7 @@ public class AddSubCommand extends BatSubCommand {
|
||||
public void execute(@NonNull BatGuild guild, @NonNull BatUser user, @NonNull TextChannel channel, @NonNull Member member, @NonNull SlashCommandInteraction interaction) {
|
||||
AutoRoleProfile profile = guild.getProfile(AutoRoleProfile.class);
|
||||
if (profile.getRoleSlotsInUse() >= profile.getMaxRoles()) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("You can only have a maximum of %d roles set for the auto role feature"
|
||||
.formatted(profile.getMaxRoles()))
|
||||
.build()).queue();
|
||||
@ -41,7 +40,7 @@ public class AddSubCommand extends BatSubCommand {
|
||||
|
||||
OptionMapping option = interaction.getOption("role");
|
||||
if (option == null) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Please provide a role to add")
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -49,7 +48,7 @@ public class AddSubCommand extends BatSubCommand {
|
||||
|
||||
Role role = option.getAsRole();
|
||||
if (profile.hasRole(role.getId())) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("The role %s is already in the auto roles list".formatted(role.getAsMention()))
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -57,7 +56,7 @@ public class AddSubCommand extends BatSubCommand {
|
||||
|
||||
profile.addRole(role.getId());
|
||||
guildService.saveGuild(guild);
|
||||
interaction.replyEmbeds(EmbedUtils.buildSuccessEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.successEmbed()
|
||||
.setDescription("Successfully added the role %s to the auto roles list".formatted(role.getAsMention()))
|
||||
.build()).queue();
|
||||
}
|
||||
|
@ -8,9 +8,7 @@ import cc.fascinated.bat.model.BatUser;
|
||||
import cc.fascinated.bat.service.GuildService;
|
||||
import lombok.NonNull;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.Role;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.api.interactions.commands.OptionMapping;
|
||||
import net.dv8tion.jda.api.interactions.commands.SlashCommandInteraction;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -33,7 +31,7 @@ public class ClearSubCommand extends BatSubCommand {
|
||||
|
||||
profile.clearRoles();
|
||||
guildService.saveGuild(guild);
|
||||
interaction.replyEmbeds(EmbedUtils.buildSuccessEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.successEmbed()
|
||||
.setDescription("Successfully cleared all auto roles")
|
||||
.build()).queue();
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package cc.fascinated.bat.features.autorole.command;
|
||||
import cc.fascinated.bat.command.BatSubCommand;
|
||||
import cc.fascinated.bat.common.EmbedUtils;
|
||||
import cc.fascinated.bat.features.autorole.profile.AutoRoleProfile;
|
||||
import cc.fascinated.bat.features.scoresaber.profile.GuildUserScoreFeedProfile;
|
||||
import cc.fascinated.bat.model.BatGuild;
|
||||
import cc.fascinated.bat.model.BatUser;
|
||||
import lombok.NonNull;
|
||||
@ -23,7 +22,7 @@ public class ListSubCommand extends BatSubCommand {
|
||||
public void execute(@NonNull BatGuild guild, @NonNull BatUser user, @NonNull TextChannel channel, @NonNull Member member, @NonNull SlashCommandInteraction interaction) {
|
||||
AutoRoleProfile profile = guild.getProfile(AutoRoleProfile.class);
|
||||
if (profile.getRoles().isEmpty()) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("There are no auto roles set")
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -38,7 +37,7 @@ public class ListSubCommand extends BatSubCommand {
|
||||
roles.append("%d. %s\n".formatted(i + 1, profile.getRoles().get(i).getAsMention()));
|
||||
}
|
||||
|
||||
EmbedBuilder embed = EmbedUtils.buildGenericEmbed();
|
||||
EmbedBuilder embed = EmbedUtils.genericEmbed();
|
||||
embed.setTitle("Auto Role List");
|
||||
embed.setDescription(roles.toString());
|
||||
interaction.replyEmbeds(embed.build()).queue();
|
||||
|
@ -32,7 +32,7 @@ public class RemoveSubCommand extends BatSubCommand {
|
||||
AutoRoleProfile profile = guild.getProfile(AutoRoleProfile.class);
|
||||
OptionMapping option = interaction.getOption("role");
|
||||
if (option == null) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Please provide a role to remove")
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -40,7 +40,7 @@ public class RemoveSubCommand extends BatSubCommand {
|
||||
|
||||
Role role = option.getAsRole();
|
||||
if (!profile.hasRole(role.getId())) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("The role %s is not in the auto roles list".formatted(role.getAsMention()))
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -48,7 +48,7 @@ public class RemoveSubCommand extends BatSubCommand {
|
||||
|
||||
profile.removeRole(role.getId());
|
||||
guildService.saveGuild(guild);
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Successfully removed the role %s from the auto roles list".formatted(role.getAsMention()))
|
||||
.build()).queue();
|
||||
}
|
||||
|
@ -1,9 +1,6 @@
|
||||
package cc.fascinated.bat.features.scoresaber;
|
||||
|
||||
import cc.fascinated.bat.common.Colors;
|
||||
import cc.fascinated.bat.common.DateUtils;
|
||||
import cc.fascinated.bat.common.NumberUtils;
|
||||
import cc.fascinated.bat.common.ScoreSaberUtils;
|
||||
import cc.fascinated.bat.common.*;
|
||||
import cc.fascinated.bat.event.EventListener;
|
||||
import cc.fascinated.bat.features.scoresaber.profile.GuildNumberOneScoreFeedProfile;
|
||||
import cc.fascinated.bat.model.BatGuild;
|
||||
@ -13,7 +10,6 @@ import cc.fascinated.bat.model.token.beatsaber.scoresaber.ScoreSaberScoreToken;
|
||||
import cc.fascinated.bat.service.DiscordService;
|
||||
import cc.fascinated.bat.service.GuildService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
@ -74,7 +70,7 @@ public class NumberOneScoreFeedListener implements EventListener {
|
||||
ScoreSaberScoreToken scoreToken = score.getScore();
|
||||
ScoreSaberLeaderboardToken leaderboardToken = score.getLeaderboard();
|
||||
ScoreSaberScoreToken.LeaderboardPlayerInfo playerInfo = scoreToken.getLeaderboardPlayerInfo();
|
||||
return new EmbedBuilder()
|
||||
return EmbedUtils.genericEmbed()
|
||||
.setAuthor(playerInfo.getName() + " just set a new #1!", "https://scoresaber.com/u/%s".formatted(playerInfo.getId()),
|
||||
"https://cdn.scoresaber.com/avatars/%s.jpg".formatted(playerInfo.getId()))
|
||||
.setDescription("**%s** (%s%s)\n[[Map Link]](%s) [[SS Profile]](%s)".formatted(
|
||||
@ -95,7 +91,6 @@ public class NumberOneScoreFeedListener implements EventListener {
|
||||
scoreToken.getMaxCombo(),
|
||||
scoreToken.getMaxCombo() == leaderboardToken.getMaxScore() ? "(FC)" : ""
|
||||
), true)
|
||||
.setColor(Colors.DEFAULT)
|
||||
.setTimestamp(DateUtils.getDateFromString(scoreToken.getTimeSet()).toInstant())
|
||||
.build();
|
||||
}
|
||||
|
@ -1,9 +1,6 @@
|
||||
package cc.fascinated.bat.features.scoresaber;
|
||||
|
||||
import cc.fascinated.bat.common.Colors;
|
||||
import cc.fascinated.bat.common.DateUtils;
|
||||
import cc.fascinated.bat.common.NumberUtils;
|
||||
import cc.fascinated.bat.common.ScoreSaberUtils;
|
||||
import cc.fascinated.bat.common.*;
|
||||
import cc.fascinated.bat.event.EventListener;
|
||||
import cc.fascinated.bat.features.scoresaber.profile.GuildUserScoreFeedProfile;
|
||||
import cc.fascinated.bat.model.token.beatsaber.scoresaber.ScoreSaberLeaderboardToken;
|
||||
@ -13,7 +10,6 @@ import cc.fascinated.bat.model.BatGuild;
|
||||
import cc.fascinated.bat.service.DiscordService;
|
||||
import cc.fascinated.bat.service.GuildService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
@ -67,7 +63,7 @@ public class UserScoreFeedListener implements EventListener {
|
||||
ScoreSaberScoreToken scoreToken = score.getScore();
|
||||
ScoreSaberLeaderboardToken leaderboardToken = score.getLeaderboard();
|
||||
ScoreSaberScoreToken.LeaderboardPlayerInfo playerInfo = scoreToken.getLeaderboardPlayerInfo();
|
||||
return new EmbedBuilder()
|
||||
return EmbedUtils.genericEmbed()
|
||||
.setAuthor(playerInfo.getName() + " just set a new score!", "https://scoresaber.com/u/%s".formatted(playerInfo.getId()),
|
||||
"https://cdn.scoresaber.com/avatars/%s.jpg".formatted(playerInfo.getId()))
|
||||
.setDescription("**%s** (%s%s)\n[[Map Link]](%s) [[SS Profile]](%s)".formatted(
|
||||
@ -88,7 +84,6 @@ public class UserScoreFeedListener implements EventListener {
|
||||
scoreToken.getMaxCombo(),
|
||||
scoreToken.getMaxCombo() == leaderboardToken.getMaxScore() ? "(FC)" : ""
|
||||
), true)
|
||||
.setColor(Colors.DEFAULT)
|
||||
.setTimestamp(DateUtils.getDateFromString(scoreToken.getTimeSet()).toInstant())
|
||||
.build();
|
||||
}
|
||||
|
@ -35,12 +35,12 @@ public class ChannelSubCommand extends BatSubCommand {
|
||||
OptionMapping option = interaction.getOption("channel");
|
||||
if (option == null) {
|
||||
if (!TextChannelUtils.isValidChannel(profile.getChannelId())) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Please provide a channel to set the ScoreSaber #1 feed channel to")
|
||||
.build()).queue();
|
||||
return;
|
||||
}
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("The current ScoreSaber #1 feed channel is %s".formatted(TextChannelUtils.getChannelMention(profile.getChannelId())))
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -48,7 +48,7 @@ public class ChannelSubCommand extends BatSubCommand {
|
||||
|
||||
GuildChannelUnion targetChannel = option.getAsChannel();
|
||||
if (targetChannel.getType() != ChannelType.TEXT) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Invalid channel type, please provide a text channel")
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -57,7 +57,7 @@ public class ChannelSubCommand extends BatSubCommand {
|
||||
profile.setChannelId(targetChannel.getId());
|
||||
guildService.saveGuild(guild);
|
||||
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Successfully set the ScoreSaber #1 feed channel to %s".formatted(targetChannel.asTextChannel().getAsMention()))
|
||||
.build()).queue();
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class ClearChannelSubCommand extends BatSubCommand {
|
||||
profile.setChannelId(null);
|
||||
guildService.saveGuild(guild);
|
||||
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Successfully cleared the ScoreSaber #1 feed channel")
|
||||
.build()).queue();
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class LinkSubCommand extends BatSubCommand {
|
||||
public void execute(@NonNull BatGuild guild, @NonNull BatUser user, @NonNull TextChannel channel, @NonNull Member member, @NonNull SlashCommandInteraction interaction) {
|
||||
OptionMapping option = interaction.getOption("link");
|
||||
if (option == null) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Please provide a ScoreSaber profile link")
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -42,7 +42,7 @@ public class LinkSubCommand extends BatSubCommand {
|
||||
|
||||
String link = option.getAsString();
|
||||
if (!link.contains("scoresaber.com/u/")) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Invalid ScoreSaber profile link")
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -55,7 +55,7 @@ public class LinkSubCommand extends BatSubCommand {
|
||||
|
||||
ScoreSaberAccountToken account = scoreSaberService.getAccount(id);
|
||||
if (account == null) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Invalid ScoreSaber profile link")
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -63,7 +63,7 @@ public class LinkSubCommand extends BatSubCommand {
|
||||
|
||||
((UserScoreSaberProfile) user.getProfile(UserScoreSaberProfile.class)).setSteamId(id);
|
||||
userService.saveUser(user);
|
||||
interaction.replyEmbeds(EmbedUtils.buildSuccessEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.successEmbed()
|
||||
.setDescription("Successfully linked your [ScoreSaber](%s) profile".formatted("https://scoresaber.com/u/%s".formatted(id)))
|
||||
.build()).queue();
|
||||
}
|
||||
|
@ -70,11 +70,11 @@ public class ScoreSaberCommand extends BatCommand {
|
||||
UserScoreSaberProfile profile = user.getProfile(UserScoreSaberProfile.class);
|
||||
if (profile.getSteamId() == null) {
|
||||
if (!isSelf) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("%s does not have a linked ScoreSaber account".formatted(user.getDiscordUser().getAsMention()))
|
||||
.build()).queue();
|
||||
}
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("You do not have a linked ScoreSaber account")
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -84,12 +84,12 @@ public class ScoreSaberCommand extends BatCommand {
|
||||
ScoreSaberAccountToken account = scoreSaberService.getAccount(profile.getSteamId());
|
||||
if (account == null) {
|
||||
if (!isSelf) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("%s has an invalid ScoreSaber account linked, please ask them to re-link their account"
|
||||
.formatted(user.getDiscordUser().getAsMention()))
|
||||
.build()).queue();
|
||||
}
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("You have an invalid ScoreSaber account linked, please re-link your account")
|
||||
.build()).queue();
|
||||
return;
|
||||
|
@ -32,14 +32,14 @@ public class UserSubCommand extends BatSubCommand {
|
||||
public void execute(@NonNull BatGuild guild, @NonNull BatUser user, @NonNull TextChannel channel, @NonNull Member member, @NonNull SlashCommandInteraction interaction) {
|
||||
OptionMapping option = interaction.getOption("user");
|
||||
if (option == null) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Please provide a user to view the ScoreSaber profile of")
|
||||
.build()).queue();
|
||||
return;
|
||||
}
|
||||
|
||||
if (option.getAsUser().isBot()) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("You cannot view the ScoreSaber profile for a Bot")
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -47,7 +47,7 @@ public class UserSubCommand extends BatSubCommand {
|
||||
|
||||
BatUser target = userService.getUser(option.getAsUser().getId());
|
||||
if (target == null) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Unknown user")
|
||||
.build()).queue();
|
||||
return;
|
||||
|
@ -35,12 +35,12 @@ public class ChannelSubCommand extends BatSubCommand {
|
||||
OptionMapping option = interaction.getOption("channel");
|
||||
if (option == null) {
|
||||
if (!TextChannelUtils.isValidChannel(profile.getChannelId())) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildSuccessEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.successEmbed()
|
||||
.setDescription("Please provide a channel to set the ScoreSaber feed channel to")
|
||||
.build()).queue();
|
||||
return;
|
||||
}
|
||||
interaction.replyEmbeds(EmbedUtils.buildSuccessEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.successEmbed()
|
||||
.setDescription("The current ScoreSaber feed channel is %s".formatted(TextChannelUtils.getChannelMention(profile.getChannelId())))
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -48,7 +48,7 @@ public class ChannelSubCommand extends BatSubCommand {
|
||||
|
||||
GuildChannelUnion targetChannel = option.getAsChannel();
|
||||
if (targetChannel.getType() != ChannelType.TEXT) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildSuccessEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.successEmbed()
|
||||
.setDescription("Invalid channel type, please provide a text channel")
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -57,7 +57,7 @@ public class ChannelSubCommand extends BatSubCommand {
|
||||
profile.setChannelId(targetChannel.getId());
|
||||
guildService.saveGuild(guild);
|
||||
|
||||
interaction.replyEmbeds(EmbedUtils.buildSuccessEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.successEmbed()
|
||||
.setDescription("Successfully set the ScoreSaber feed channel to %s".formatted(targetChannel.asTextChannel().getAsMention()))
|
||||
.build()).queue();
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class ClearChannelSubCommand extends BatSubCommand {
|
||||
profile.setChannelId(null);
|
||||
guildService.saveGuild(guild);
|
||||
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("Successfully cleared the ScoreSaber feed channel")
|
||||
.build()).queue();
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class ClearUsersSubCommand extends BatSubCommand {
|
||||
profile.getTrackedUsers().clear();
|
||||
guildService.saveGuild(guild);
|
||||
|
||||
interaction.replyEmbeds(EmbedUtils.buildSuccessEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.successEmbed()
|
||||
.setDescription("Successfully cleared all users from the ScoreSaber feed")
|
||||
.build()).queue();
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class UserSubCommand extends BatSubCommand {
|
||||
OptionMapping option = interaction.getOption("user");
|
||||
if (option == null){
|
||||
if (profile.getTrackedUsers().isEmpty()) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("There are no users being tracked in the ScoreSaber feed")
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -49,7 +49,7 @@ public class UserSubCommand extends BatSubCommand {
|
||||
"https://scoresaber.com/u/%s".formatted(accountId)
|
||||
));
|
||||
}
|
||||
interaction.replyEmbeds(EmbedUtils.buildGenericEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.genericEmbed()
|
||||
.setDescription("The current users being tracked in the ScoreSaber feed are:\n%s".formatted(stringBuilder.toString()))
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -59,7 +59,7 @@ public class UserSubCommand extends BatSubCommand {
|
||||
BatUser targetUser = userService.getUser(target.getId());
|
||||
UserScoreSaberProfile targetProfile = targetUser.getProfile(UserScoreSaberProfile.class);
|
||||
if (targetProfile.getSteamId() == null) {
|
||||
interaction.replyEmbeds(EmbedUtils.buildErrorEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.errorEmbed()
|
||||
.setDescription("The user you are trying to track does not have a linked ScoreSaber profile")
|
||||
.build()).queue();
|
||||
return;
|
||||
@ -67,12 +67,12 @@ public class UserSubCommand extends BatSubCommand {
|
||||
|
||||
if (profile.getTrackedUsers().contains(targetProfile.getSteamId())) {
|
||||
profile.getTrackedUsers().remove(targetProfile.getSteamId());
|
||||
interaction.replyEmbeds(EmbedUtils.buildSuccessEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.successEmbed()
|
||||
.setDescription("Successfully removed %s from the ScoreSaber feed".formatted(target.getAsMention()))
|
||||
.build()).queue();
|
||||
} else {
|
||||
profile.getTrackedUsers().add(targetProfile.getSteamId());
|
||||
interaction.replyEmbeds(EmbedUtils.buildSuccessEmbed()
|
||||
interaction.replyEmbeds(EmbedUtils.successEmbed()
|
||||
.setDescription("Successfully added %s to the ScoreSaber feed".formatted(target.getAsMention()))
|
||||
.build()).queue();
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ public class CommandService extends ListenerAdapter {
|
||||
} catch (Exception ex) {
|
||||
log.error("An error occurred while executing command \"{}\"", commandName, ex);
|
||||
|
||||
event.replyEmbeds(EmbedUtils.buildSuccessEmbed()
|
||||
event.replyEmbeds(EmbedUtils.successEmbed()
|
||||
.setDescription("An error occurred while executing the command\n\n" + ex.getLocalizedMessage())
|
||||
.build()).queue();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user