reformat: final reformat

This commit is contained in:
ZtereoHYPE 2022-02-08 22:27:27 +01:00
parent 099408f545
commit e2b3c776e6
9 changed files with 47 additions and 61 deletions

View file

@ -21,10 +21,8 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Play implements Command {
private static final Pattern URL_PATTERN = Pattern.compile("^(http|https)://([a-z]+\\.[a-z]+)+/\\S+$",
Pattern.CASE_INSENSITIVE);
private static final Pattern SPOTIFY_URL_PATTERN = Pattern.compile(
"^(?:https://open\\.spotify\\.com/(track|playlist)/)(\\S+(?:\\?si=\\S+))$");
private static final Pattern URL_PATTERN = Pattern.compile("^(http|https)://([a-z]+\\.[a-z]+)+/\\S+$", Pattern.CASE_INSENSITIVE);
private static final Pattern SPOTIFY_URL_PATTERN = Pattern.compile("^(?:https://open\\.spotify\\.com/(track|playlist)/)(\\S+(?:\\?si=\\S+))$");
private final CommandMeta meta;
@ -55,9 +53,7 @@ public class Play implements Command {
TrackManager trackManager = TrackManagers.getGuildTrackManager(guild, messageChannel);
if (trackManager == null || !trackManager.getPlayer().isPaused()) {
messageChannel.sendMessage(
"What should I play? Type the name of the song after the command or use a YouTube link!")
.queue();
messageChannel.sendMessage("What should I play? Type the name of the song after the command or use a YouTube link!").queue();
return;
}
@ -99,8 +95,6 @@ public class Play implements Command {
TrackManager trackManager = TrackManagers.getOrCreateGuildTrackManager(guild, messageChannel, voiceChannel);
ZtereoMUSIC.getInstance()
.getPlayerManager()
.loadItem(identifier, new CustomAudioLoadResultHandler(trackManager, messageChannel));
ZtereoMUSIC.getInstance().getPlayerManager().loadItem(identifier, new CustomAudioLoadResultHandler(trackManager, messageChannel));
}
}

View file

@ -37,7 +37,7 @@ public class Queue implements Command {
public void execute(MessageReceivedEvent messageEvent, String[] args) {
Guild guild = messageEvent.getGuild();
VoiceChannel voiceChannel = Objects.requireNonNull(Objects.requireNonNull(messageEvent.getMember())
.getVoiceState()).getChannel();
.getVoiceState()).getChannel();
MessageChannel messageChannel = messageEvent.getChannel();
TrackManager trackManager = TrackManagers.getOrCreateGuildTrackManager(guild, messageChannel, voiceChannel);

View file

@ -24,10 +24,7 @@ public class Remove implements Command {
.description("Remove the chosen item.")
.isNsfw(false)
.isHidden(false)
.checks(new VoiceChecks[] { VoiceChecks.BOT_CONNECTED,
VoiceChecks.BOT_PLAYING,
VoiceChecks.USER_CONNECTED,
VoiceChecks.SAME_VC_IF_CONNECTED })
.checks(new VoiceChecks[] { VoiceChecks.BOT_CONNECTED, VoiceChecks.BOT_PLAYING, VoiceChecks.USER_CONNECTED, VoiceChecks.SAME_VC_IF_CONNECTED })
.build();
}
@ -49,9 +46,7 @@ public class Remove implements Command {
// if there's the wrong amount of arguments send the usage
if (args.length != 1) {
messageChannel.sendMessage(
"Usage: `remove [index of song to remove]/first/last`. Use the `queue` command to find the index.")
.queue();
messageChannel.sendMessage("Usage: `remove [index of song to remove]/first/last`. Use the `queue` command to find the index.").queue();
return;
}
@ -76,9 +71,7 @@ public class Remove implements Command {
} else if (indexAliases.containsKey(index.toLowerCase(Locale.ROOT))) {
parsedIndex = indexAliases.get(index);
} else {
messageChannel.sendMessage(
"Usage: `remove [index of song to remove]/first/last`. Use the `queue` command to find the index.")
.queue();
messageChannel.sendMessage("Usage: `remove [index of song to remove]/first/last`. Use the `queue` command to find the index.").queue();
return;
}