use of com.sedmelluq.discord.lavaplayer.demo.controller.BotCommandHandler in project lavaplayer by sedmelluq.
the class MusicController method deserialize.
@BotCommandHandler
private void deserialize(Message message, String content) throws IOException {
outputChannel.set((TextChannel) message.getChannel());
connectToFirstVoiceChannel(guild.getAudioManager());
byte[] bytes = Base64.decode(content);
MessageInput inputStream = new MessageInput(new ByteArrayInputStream(bytes));
DecodedTrackHolder holder;
while ((holder = manager.decodeTrack(inputStream)) != null) {
if (holder.decodedTrack != null) {
scheduler.addToQueue(holder.decodedTrack);
}
}
}
use of com.sedmelluq.discord.lavaplayer.demo.controller.BotCommandHandler in project lavaplayer by sedmelluq.
the class MusicController method serialize.
@BotCommandHandler
private void serialize(Message message) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
MessageOutput outputStream = new MessageOutput(baos);
for (AudioTrack track : scheduler.drainQueue()) {
manager.encodeTrack(outputStream, track);
}
outputStream.finish();
message.getChannel().sendMessage(Base64.encodeBytes(baos.toByteArray())).queue();
}
use of com.sedmelluq.discord.lavaplayer.demo.controller.BotCommandHandler in project lavaplayer by sedmelluq.
the class MusicController method nodeinfo.
@BotCommandHandler
private void nodeinfo(Message message) {
for (RemoteNode node : manager.getRemoteNodeRegistry().getNodes()) {
String report = buildReportForNode(node);
message.getChannel().sendMessage(report).queue();
}
}
Aggregations