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