change: reformat code because i messed up first time

This commit is contained in:
ZtereoHYPE 2022-02-04 14:30:37 +01:00
parent 41438cae0d
commit 735d4bc193
13 changed files with 130 additions and 130 deletions

View file

@ -18,10 +18,10 @@ import java.util.ArrayList;
import java.util.List;
public class TrackManager extends AudioEventAdapter {
private final @Getter AudioPlayer player;
public final List<AudioTrack> trackQueue = new ArrayList<>();
private @Getter @Setter MessageChannel infoChannel;
private final @Getter AudioPlayer player;
private final Guild guild;
private @Getter @Setter MessageChannel infoChannel;
public TrackManager(AudioPlayerManager playerManager, MessageChannel infoChannel, Guild guild) {
this.player = playerManager.createPlayer();
@ -120,7 +120,8 @@ public class TrackManager extends AudioEventAdapter {
@Override public void onTrackException(AudioPlayer player, AudioTrack track, FriendlyException exception) {
infoChannel.sendMessage(
"Uh oh, a track did something strange. Ask the owner to check for errors in console. Skpping...").queue();
"Uh oh, a track did something strange. Ask the owner to check for errors in console. Skpping...")
.queue();
System.out.println(exception.getCause().getMessage());
}

View file

@ -24,7 +24,7 @@ public class Ping implements Command {
}
public void execute(MessageReceivedEvent messageEvent, String[] args) {
messageEvent.getMessage().reply("get ping'd lolmao").queue();
messageEvent.getMessage().reply("git ping'd lolmao").queue();
}
}

View file

@ -56,7 +56,8 @@ public class Play implements Command {
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();
"What should I play? Type the name of the song after the command or use a YouTube link!")
.queue();
return;
}

View file

@ -31,6 +31,18 @@ public class Remove implements Command {
.build();
}
public static boolean isNumeric(String strNum) {
if (strNum == null) {
return false;
}
try {
int i = Integer.parseInt(strNum);
} catch (NumberFormatException nfe) {
return false;
}
return true;
}
@Override public void execute(MessageReceivedEvent messageEvent, String[] args) {
Guild guild = messageEvent.getGuild();
MessageChannel messageChannel = messageEvent.getChannel();
@ -78,16 +90,4 @@ public class Remove implements Command {
String title = trackManager.removeQueueItem(parsedIndex - 1);
messageChannel.sendMessage("Removed " + title).queue();
}
public static boolean isNumeric(String strNum) {
if (strNum == null) {
return false;
}
try {
int i = Integer.parseInt(strNum);
} catch (NumberFormatException nfe) {
return false;
}
return true;
}
}

View file

@ -30,10 +30,8 @@ public class SpotifyApiHelper {
.get("spotify_client_secret");
private static final Pattern IDENTIFIER_PATTERN = Pattern.compile(
"(?:(?<=https://open\\.spotify\\.com/track/)|(?<=https://open\\.spotify\\.com/playlist/))(\\S+(?=\\?si=\\S))");
private static String spotifyToken;
private static final Json JSON = Json.json();
private static String spotifyToken;
public static void startTokenTimer() {
Timer timer = new Timer();