Search in sources :

Example 1 with PlayerRegistry

use of fredboat.audio.player.PlayerRegistry in project FredBoat by Frederikam.

the class PlaySplitCommand method onInvoke.

@Override
public void onInvoke(@Nonnull CommandContext context) {
    if (!context.hasArguments()) {
        HelpCommand.sendFormattedCommandHelp(context);
        return;
    }
    PlayerRegistry playerRegistry = Launcher.getBotController().getPlayerRegistry();
    if (!playerLimiter.checkLimitResponsive(context, playerRegistry))
        return;
    IdentifierContext ic = new IdentifierContext(Launcher.getBotController().getJdaEntityProvider(), context.args[0], context.channel, context.invoker);
    ic.setSplit(true);
    GuildPlayer player = playerRegistry.getOrCreate(context.guild);
    player.queue(ic);
    player.setPause(false);
    context.deleteMessage();
}
Also used : GuildPlayer(fredboat.audio.player.GuildPlayer) PlayerRegistry(fredboat.audio.player.PlayerRegistry) IdentifierContext(fredboat.audio.queue.IdentifierContext)

Aggregations

GuildPlayer (fredboat.audio.player.GuildPlayer)1 PlayerRegistry (fredboat.audio.player.PlayerRegistry)1 IdentifierContext (fredboat.audio.queue.IdentifierContext)1