Hey guys
This commit is contained in:
parent
697f3d0265
commit
f30066308b
1 changed files with 10 additions and 12 deletions
|
|
@ -130,6 +130,8 @@ public class AudioManager {
|
|||
});
|
||||
}
|
||||
|
||||
/*
|
||||
TODO: DJ integration
|
||||
public boolean isDj(Member member) {
|
||||
return member.getRoles().stream().anyMatch(r -> r.getName().equals("DJ"));
|
||||
}
|
||||
|
|
@ -137,22 +139,18 @@ public class AudioManager {
|
|||
public boolean isCurrentDj(Member member) {
|
||||
return getTrackManager(member.getGuild()).getTrackInfo(getPlayer(member.getGuild()).getPlayingTrack()).getAuthor().equals(member);
|
||||
}
|
||||
|
||||
*/
|
||||
public void forceSkipTrack(CommandEvent event) {
|
||||
getPlayer(event.getGuild()).stopTrack();
|
||||
}
|
||||
|
||||
public String getTimestamp(long milis) {
|
||||
long seconds = milis / 1000;
|
||||
long hours = Math.floorDiv(seconds, 3600);
|
||||
seconds = seconds - (hours * 3600);
|
||||
long mins = Math.floorDiv(seconds, 60);
|
||||
seconds = seconds - (mins * 60);
|
||||
return (hours == 0 ? "" : hours + ":") + String.format("%02d", mins) + ":" + String.format("%02d", seconds);
|
||||
}
|
||||
|
||||
public String getOrNull(String s) {
|
||||
return s.isEmpty() ? "N/A" : s;
|
||||
public String getTimestamp(long m) {
|
||||
long s = m / 1000;
|
||||
long hours = Math.floorDiv(s, 3600);
|
||||
s = s - (hours * 3600);
|
||||
long minutes = Math.floorDiv(s, 60);
|
||||
s = s - (minutes * 60);
|
||||
return (hours == 0 ? "" : hours + ":") + String.format("%02d", minutes) + ":" + String.format("%02d", s);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue