Class MusicService
java.lang.Object
dev.despical.musicbot.audio.MusicService
- All Implemented Interfaces:
PlaybackEventListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final record -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMusicService(GuildStateStore stateStore, SpotifyService spotifyService, TranslationService translations, YoutubeConfig youtubeConfig) -
Method Summary
Modifier and TypeMethodDescriptionnet.dv8tion.jda.api.entities.MessageEmbedbuildHistoryReplayEmbed(String guildId, GuildStateStore.TrackHistoryEntry entry, net.dv8tion.jda.api.entities.Member requester, boolean queued, boolean replayLast) List<net.dv8tion.jda.api.components.actionrow.ActionRow> buildPlaybackControlRows(net.dv8tion.jda.api.entities.Guild guild) voidcancelSuppressedQueuedNotification(String guildId) voidcancelSuppressedStartNotification(String guildId) booleancanControl(net.dv8tion.jda.api.entities.Member member, net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel memberChannel) getHistory(String guildId) getNowPlaying(net.dv8tion.jda.api.entities.Guild guild) getQueue(net.dv8tion.jda.api.entities.Guild guild, int page) booleanhasActivePlayback(net.dv8tion.jda.api.entities.Guild guild) booleanisConnectedToVoice(net.dv8tion.jda.api.entities.Guild guild) booleanisPaused(net.dv8tion.jda.api.entities.Guild guild) booleanisPlaying(net.dv8tion.jda.api.entities.Guild guild) voidleave(net.dv8tion.jda.api.entities.Guild guild) voidonTrackEnded(String guildId, PlaybackMetadata metadata, com.sedmelluq.discord.lavaplayer.track.AudioTrack track, com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason endReason) voidonTrackStarted(String guildId, PlaybackMetadata metadata, com.sedmelluq.discord.lavaplayer.track.AudioTrack track) voidpause(net.dv8tion.jda.api.entities.Guild guild) play(net.dv8tion.jda.api.entities.Member member, String query, int repeatCount, boolean loopForever) playInChannel(net.dv8tion.jda.api.entities.Guild guild, net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel targetChannel, String requestedBy, String requestedByAvatarUrl, String query, int repeatCount, boolean loopForever, boolean forceMove) playSearchResult(net.dv8tion.jda.api.entities.Member member, MusicService.SearchResult searchResult, int repeatCount, boolean loopForever) playSearchResultInChannel(net.dv8tion.jda.api.entities.Guild guild, net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel targetChannel, String requestedBy, String requestedByAvatarUrl, MusicService.SearchResult searchResult, int repeatCount, boolean loopForever, boolean forceMove) voidregisterNotificationChannel(String guildId, net.dv8tion.jda.api.entities.channel.middleman.MessageChannel messageChannel) replayHistory(net.dv8tion.jda.api.entities.Member member, int index) voidresume(net.dv8tion.jda.api.entities.Guild guild) voidsendTextNotification(String guildId, String message) voidsetActiveControlMessage(String guildId, net.dv8tion.jda.api.entities.channel.middleman.MessageChannel channel, long messageId) intsetVolume(net.dv8tion.jda.api.entities.Guild guild, int volume) booleanskip(net.dv8tion.jda.api.entities.Guild guild, int count) voidstop(net.dv8tion.jda.api.entities.Guild guild) voidsuppressNextQueuedNotification(String guildId) voidsuppressNextStartNotification(String guildId)
-
Field Details
-
PLAYBACK_TOGGLE_BUTTON_ID
- See Also:
-
PLAYBACK_SKIP_BUTTON_ID
- See Also:
-
PLAYBACK_STOP_BUTTON_ID
- See Also:
-
-
Constructor Details
-
MusicService
public MusicService(GuildStateStore stateStore, SpotifyService spotifyService, TranslationService translations, YoutubeConfig youtubeConfig)
-
-
Method Details
-
registerNotificationChannel
public void registerNotificationChannel(String guildId, net.dv8tion.jda.api.entities.channel.middleman.MessageChannel messageChannel) -
play
public CompletableFuture<MusicService.QueueResult> play(net.dv8tion.jda.api.entities.Member member, String query, int repeatCount, boolean loopForever) -
playSearchResult
public CompletableFuture<MusicService.QueueResult> playSearchResult(net.dv8tion.jda.api.entities.Member member, MusicService.SearchResult searchResult, int repeatCount, boolean loopForever) -
search
-
shouldPromptForSearchSelection
-
playInChannel
public CompletableFuture<MusicService.QueueResult> playInChannel(net.dv8tion.jda.api.entities.Guild guild, net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel targetChannel, String requestedBy, String requestedByAvatarUrl, String query, int repeatCount, boolean loopForever, boolean forceMove) -
playSearchResultInChannel
public CompletableFuture<MusicService.QueueResult> playSearchResultInChannel(net.dv8tion.jda.api.entities.Guild guild, net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel targetChannel, String requestedBy, String requestedByAvatarUrl, MusicService.SearchResult searchResult, int repeatCount, boolean loopForever, boolean forceMove) -
pause
public void pause(net.dv8tion.jda.api.entities.Guild guild) -
resume
public void resume(net.dv8tion.jda.api.entities.Guild guild) -
isConnectedToVoice
public boolean isConnectedToVoice(net.dv8tion.jda.api.entities.Guild guild) -
isPaused
public boolean isPaused(net.dv8tion.jda.api.entities.Guild guild) -
stop
public void stop(net.dv8tion.jda.api.entities.Guild guild) -
skip
-
getQueue
-
getNowPlaying
-
setVolume
public int setVolume(net.dv8tion.jda.api.entities.Guild guild, int volume) -
onTrackStarted
public void onTrackStarted(String guildId, PlaybackMetadata metadata, com.sedmelluq.discord.lavaplayer.track.AudioTrack track) - Specified by:
onTrackStartedin interfacePlaybackEventListener
-
onTrackEnded
public void onTrackEnded(String guildId, PlaybackMetadata metadata, com.sedmelluq.discord.lavaplayer.track.AudioTrack track, com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason endReason) - Specified by:
onTrackEndedin interfacePlaybackEventListener
-
leave
public void leave(net.dv8tion.jda.api.entities.Guild guild) -
sendTextNotification
-
suppressNextStartNotification
-
cancelSuppressedStartNotification
-
suppressNextQueuedNotification
-
cancelSuppressedQueuedNotification
-
buildHistoryReplayEmbed
public net.dv8tion.jda.api.entities.MessageEmbed buildHistoryReplayEmbed(String guildId, GuildStateStore.TrackHistoryEntry entry, net.dv8tion.jda.api.entities.Member requester, boolean queued, boolean replayLast) -
setActiveControlMessage
public void setActiveControlMessage(String guildId, net.dv8tion.jda.api.entities.channel.middleman.MessageChannel channel, long messageId) -
getHistory
-
replayHistory
public CompletableFuture<MusicService.QueueResult> replayHistory(net.dv8tion.jda.api.entities.Member member, int index) -
canControl
public boolean canControl(net.dv8tion.jda.api.entities.Member member, net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel memberChannel) -
hasActivePlayback
public boolean hasActivePlayback(net.dv8tion.jda.api.entities.Guild guild) -
isPlaying
public boolean isPlaying(net.dv8tion.jda.api.entities.Guild guild) -
buildPlaybackControlRows
public List<net.dv8tion.jda.api.components.actionrow.ActionRow> buildPlaybackControlRows(net.dv8tion.jda.api.entities.Guild guild)
-