Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
- Updated LavaPlayer
Browse files Browse the repository at this point in the history
- Added the new YouTube source by LavalinkDevs
  • Loading branch information
Eukon05 committed Sep 10, 2024
1 parent 5e3f120 commit 3390672
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
13 changes: 10 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<properties>

<java.version>17</java.version>
<lavaplayer.version>afec211f05c9dcf0b6ee44276a02f0316ea2458a-SNAPSHOT</lavaplayer.version>
<lavaplayer.version>2.2.1</lavaplayer.version>
<ytsource.version>1.7.2</ytsource.version>
<javacord.version>3.8.0</javacord.version>
<gson.version>2.11.0</gson.version>
<kcommando.version>5.1.0</kcommando.version>
Expand All @@ -22,9 +23,9 @@

<repositories>
<repository>
<id>arbjergDev</id>
<id>arbjergDev-releases</id>
<name>Lavalink Repository</name>
<url>https://maven.lavalink.dev/snapshots</url>
<url>https://maven.lavalink.dev/releases</url>
</repository>
<repository>
<id>jitpack</id>
Expand Down Expand Up @@ -52,6 +53,12 @@
<version>${lavaplayer.version}</version>
</dependency>

<dependency>
<groupId>dev.lavalink.youtube</groupId>
<artifactId>v2</artifactId>
<version>${ytsource.version}</version>
</dependency>

<dependency>
<groupId>org.javacord</groupId>
<artifactId>javacord</artifactId>
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/eukon05/dilanbot/music/MusicService.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager;
import com.sedmelluq.discord.lavaplayer.source.AudioSourceManagers;
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import dev.lavalink.youtube.clients.AndroidTestsuiteWithThumbnail;
import dev.lavalink.youtube.clients.MusicWithThumbnail;
import dev.lavalink.youtube.clients.WebWithThumbnail;
import org.javacord.api.audio.AudioConnection;
import org.javacord.api.entity.channel.ServerVoiceChannel;
import org.javacord.api.entity.server.Server;
Expand All @@ -23,7 +26,9 @@ public class MusicService {
private final AudioPlayerManager playerManager = new DefaultAudioPlayerManager();

public MusicService() {
AudioSourceManagers.registerRemoteSources(playerManager);
playerManager.registerSourceManager(new dev.lavalink.youtube.YoutubeAudioSourceManager(new MusicWithThumbnail(), new WebWithThumbnail(), new AndroidTestsuiteWithThumbnail()));

AudioSourceManagers.registerRemoteSources(playerManager, com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager.class);
AudioSourceManagers.registerLocalSource(playerManager);
}

Expand Down

0 comments on commit 3390672

Please sign in to comment.