mirror of
https://github.com/JonasunderscoreJones/ZtereoMUSIC.git
synced 2025-10-25 21:49:17 +02:00
new: audiochecks system! according to reperak it sucks but hey im kinda happy with it
This commit is contained in:
parent
7276ff91a0
commit
77785bc44f
4 changed files with 103 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ import net.dv8tion.jda.api.entities.VoiceChannel;
|
|||
import java.util.Objects;
|
||||
|
||||
public class TrackManagers {
|
||||
//todo: change to a statement that only returns a trackmanager if it exists and overload it to accept various things eg guild but also vc or infoMessage channel
|
||||
public static TrackManager getGuildTrackManager(Guild guild) {
|
||||
long guildId = guild.getIdLong();
|
||||
|
||||
|
|
@ -23,11 +24,13 @@ public class TrackManagers {
|
|||
return trackManager;
|
||||
}
|
||||
|
||||
//todo: rename to getOrCreateGuildTrackManager
|
||||
public static TrackManager getGuildTrackManager(Guild guild, MessageChannel infoChannel, VoiceChannel connectedChannel, VoiceChannel requestedChannel) {
|
||||
long guildId = guild.getIdLong();
|
||||
boolean isInSameVC = Objects.equals(connectedChannel, requestedChannel);
|
||||
|
||||
// If I get called in a different vc I delete the old manager
|
||||
//todo: move this check to the audio micropermissions and handle it there
|
||||
if (!isInSameVC) {
|
||||
ZtereoMUSIC.getInstance().getGuildTrackManagerMap().remove(guildId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue