Fix music bot YouTube playback
This commit is contained in:
		
							parent
							
								
									25acb23488
								
							
						
					
					
						commit
						991d50a945
					
				
							
								
								
									
										14
									
								
								pom.xml
								
								
								
								
							
							
						
						
									
										14
									
								
								pom.xml
								
								
								
								
							| 
						 | 
				
			
			@ -63,6 +63,11 @@
 | 
			
		|||
			<id>oss.sonatype.org</id>
 | 
			
		||||
			<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
 | 
			
		||||
		</repository>
 | 
			
		||||
		<repository>
 | 
			
		||||
            <id>arbjergDev-releases</id>
 | 
			
		||||
            <name>Lavalink Repository</name>
 | 
			
		||||
            <url>https://maven.lavalink.dev/releases</url>
 | 
			
		||||
        </repository>
 | 
			
		||||
		<repository>
 | 
			
		||||
			<id>jitpack.io</id>
 | 
			
		||||
			<url>https://jitpack.io</url>
 | 
			
		||||
| 
						 | 
				
			
			@ -114,7 +119,7 @@
 | 
			
		|||
		<dependency>
 | 
			
		||||
			<groupId>net.dv8tion</groupId>
 | 
			
		||||
			<artifactId>JDA</artifactId>
 | 
			
		||||
			<version>5.3.0</version>
 | 
			
		||||
			<version>5.6.1</version>
 | 
			
		||||
		</dependency>
 | 
			
		||||
		<dependency>
 | 
			
		||||
			<groupId>com.github.cage</groupId>
 | 
			
		||||
| 
						 | 
				
			
			@ -134,8 +139,13 @@
 | 
			
		|||
		<dependency>
 | 
			
		||||
			<groupId>dev.arbjerg</groupId>
 | 
			
		||||
			<artifactId>lavaplayer</artifactId>
 | 
			
		||||
			<version>2.2.3</version>
 | 
			
		||||
			<version>2.2.4</version>
 | 
			
		||||
		</dependency>
 | 
			
		||||
		<dependency>
 | 
			
		||||
            <groupId>dev.lavalink.youtube</groupId>
 | 
			
		||||
            <artifactId>v2</artifactId>
 | 
			
		||||
            <version>1.13.3</version>
 | 
			
		||||
        </dependency>
 | 
			
		||||
		<dependency>
 | 
			
		||||
			<groupId>org.pf4j</groupId>
 | 
			
		||||
			<artifactId>pf4j</artifactId>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -74,6 +74,7 @@ import com.sedmelluq.discord.lavaplayer.source.AudioSourceManagers;
 | 
			
		|||
 | 
			
		||||
import ch.qos.logback.core.rolling.RollingFileAppender;
 | 
			
		||||
import ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy;
 | 
			
		||||
import dev.lavalink.youtube.YoutubeAudioSourceManager;
 | 
			
		||||
import net.dv8tion.jda.api.JDA;
 | 
			
		||||
import net.dv8tion.jda.api.entities.Guild;
 | 
			
		||||
import net.dv8tion.jda.api.requests.GatewayIntent;
 | 
			
		||||
| 
						 | 
				
			
			@ -104,6 +105,7 @@ public class Main {
 | 
			
		|||
 | 
			
		||||
	private static AudioPlayerManager playerManager;
 | 
			
		||||
 | 
			
		||||
	@SuppressWarnings("deprecation")
 | 
			
		||||
	public static void main(String[] args){
 | 
			
		||||
		if(!isPlugin) {
 | 
			
		||||
			pluginsDir = new File("plugins");
 | 
			
		||||
| 
						 | 
				
			
			@ -125,7 +127,10 @@ public class Main {
 | 
			
		|||
		log.info("Running version: " + BColor.MAGENTA_BOLD + version);
 | 
			
		||||
 | 
			
		||||
		playerManager = new DefaultAudioPlayerManager();
 | 
			
		||||
		AudioSourceManagers.registerRemoteSources(playerManager);
 | 
			
		||||
		YoutubeAudioSourceManager ytSourceManager = new dev.lavalink.youtube.YoutubeAudioSourceManager();
 | 
			
		||||
		playerManager.registerSourceManager(ytSourceManager);
 | 
			
		||||
		AudioSourceManagers.registerRemoteSources(playerManager,
 | 
			
		||||
                com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager.class);
 | 
			
		||||
 | 
			
		||||
		mainBiscuit = new Biscuit(null, null, log);
 | 
			
		||||
		startJDA();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,7 +32,7 @@ public class GetConfigCommand extends ClientCommand{
 | 
			
		|||
			FileUpload confUpload = FileUpload.fromData(config);
 | 
			
		||||
			confUpload.setName("config-" + b.getProperties().getGuildCode() + ".properties");
 | 
			
		||||
			//event.getChannel().sendFile(config, "config-" + b.getProperties().getGuildCode() + ".properties").queue();
 | 
			
		||||
			event.getChannel().asTextChannel().sendFiles(confUpload);
 | 
			
		||||
			event.getChannel().asTextChannel().sendFiles(confUpload).queue();
 | 
			
		||||
		}else {
 | 
			
		||||
			b.log(BColor.MAGENTA_BOLD + event.getAuthor().getName() + " lacks permission to view the config!");
 | 
			
		||||
			MessageText.sendTimed(event.getChannel().asTextChannel(), event.getAuthor().getAsMention() + " You do not have "
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue