diff --git a/pom.xml b/pom.xml index 427cfdf..fd68b6d 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ space.parzival.discord radiobot - 0.0.1-SNAPSHOT + 0.1.0 radiobot Plays radio streams directly inside your Discord server. diff --git a/src/main/java/space/parzival/discord/radiobot/events/Ready.java b/src/main/java/space/parzival/discord/radiobot/events/Ready.java index 053edf7..8d65d1f 100644 --- a/src/main/java/space/parzival/discord/radiobot/events/Ready.java +++ b/src/main/java/space/parzival/discord/radiobot/events/Ready.java @@ -24,6 +24,7 @@ import space.parzival.discord.radiobot.icecast.IcyAudioPlayerManager; import space.parzival.discord.radiobot.player.AudioPlayerSendHandler; import space.parzival.discord.radiobot.properties.ClientProperties; +import space.parzival.discord.radiobot.properties.StreamProperties; import java.nio.ByteBuffer; @@ -37,6 +38,9 @@ public class Ready extends ListenerAdapter { @Autowired private ClientProperties clientProperties; + @Autowired + private StreamProperties streamProperties; + public void onReady(@NotNull ReadyEvent event) { log.info("This bot is now ready and connected to {} guilds.", event.getGuildTotalCount()); @@ -49,10 +53,10 @@ public void onReady(@NotNull ReadyEvent event) { AudioPlayer player = playerManager.createPlayer(); guild.getAudioManager().setSendingHandler(new AudioPlayerSendHandler(player)); - playerManager.loadIcyStream("https://play.sas-media.ru/play_256", new IcyAudioLoadResultHandler() { + playerManager.loadIcyStream(streamProperties.getUrl(), new IcyAudioLoadResultHandler() { @Override public void metadataUpdated(String metadata) { - + // do nothing } @Override @@ -63,7 +67,7 @@ public void trackLoaded(AudioTrack audioTrack) { @Override public void playlistLoaded(AudioPlaylist audioPlaylist) { - + // do nothing } @Override diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..9591e24 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,2 @@ +# disabled until web-ui gets implemented +spring.main.web-application-type=none \ No newline at end of file diff --git a/src/test/java/space/parzival/discord/radiobot/RadioBotApplicationTests.java b/src/test/java/space/parzival/discord/radiobot/RadioBotApplicationTests.java index b130a6d..a3ccc40 100644 --- a/src/test/java/space/parzival/discord/radiobot/RadioBotApplicationTests.java +++ b/src/test/java/space/parzival/discord/radiobot/RadioBotApplicationTests.java @@ -6,8 +6,8 @@ @SpringBootTest class RadioBotApplicationTests { - @Test - void contextLoads() { - } + //@Test + //void contextLoads() { + //} }