Search in sources :

Example 1 with MusicManager

use of fun.rubicon.core.music.MusicManager in project Rubicon by Rubicon-Bot.

the class CommandVolume method execute.

@Override
protected Message execute(CommandManager.ParsedCommandInvocation parsedCommandInvocation, UserPermissions userPermissions) {
    UserSQL userSQL = UserSQL.fromUser(parsedCommandInvocation.getAuthor());
    if (!userSQL.isPremium()) {
        return EmbedUtil.message(EmbedUtil.noPremium());
    }
    MusicManager manager = new MusicManager(parsedCommandInvocation);
    Message msg = manager.executeVolume();
    if (msg == null)
        return createHelpMessage();
    else
        return msg;
}
Also used : UserSQL(fun.rubicon.sql.UserSQL) MusicManager(fun.rubicon.core.music.MusicManager) Message(net.dv8tion.jda.core.entities.Message)

Example 2 with MusicManager

use of fun.rubicon.core.music.MusicManager in project Rubicon by Rubicon-Bot.

the class CommandForceplay method execute.

@Override
protected Message execute(CommandManager.ParsedCommandInvocation parsedCommandInvocation, UserPermissions userPermissions) {
    UserSQL userSQL = new UserSQL(parsedCommandInvocation.getAuthor());
    if (!userSQL.isPremium()) {
        return EmbedUtil.message(EmbedUtil.noPremium());
    }
    MusicManager manager = new MusicManager(parsedCommandInvocation);
    return manager.playMusic(true);
}
Also used : UserSQL(fun.rubicon.sql.UserSQL) MusicManager(fun.rubicon.core.music.MusicManager)

Example 3 with MusicManager

use of fun.rubicon.core.music.MusicManager in project Rubicon by Rubicon-Bot.

the class CommandMaintenance method execute.

@Override
protected Message execute(CommandManager.ParsedCommandInvocation parsedCommandInvocation, UserPermissions userPermissions) {
    if (parsedCommandInvocation.getArgs().length == 1) {
        if (parsedCommandInvocation.getArgs()[0].equalsIgnoreCase("false")) {
            disable();
            return EmbedUtil.message(EmbedUtil.success("Disabled maintenance", "Successfully disabled maintenance"));
        }
    }
    if (parsedCommandInvocation.getArgs().length < 1)
        return createHelpMessage();
    // Enabling with MaintenanceCommand
    RubiconBot.getConfiguration().set("maintenance", "1");
    // Build Status message
    StringBuilder msg = new StringBuilder();
    for (int i = 0; i < parsedCommandInvocation.getArgs().length; i++) {
        msg.append(parsedCommandInvocation.getArgs()[i]).append(" ");
    }
    // Set playing status
    RubiconBot.getConfiguration().set("playingStatus", msg.toString());
    enable();
    // Play maintenance sound
    MusicManager manager = new MusicManager(parsedCommandInvocation);
    manager.maintenanceSound();
    SafeMessage.sendMessage(parsedCommandInvocation.getTextChannel(), new EmbedBuilder().setColor(Colors.COLOR_PRIMARY).setTitle("Activated Maintenance").setAuthor(parsedCommandInvocation.getAuthor().getName(), null, parsedCommandInvocation.getAuthor().getEffectiveAvatarUrl()).setDescription("Bot will only respond to owners.").build());
    return null;
}
Also used : MusicManager(fun.rubicon.core.music.MusicManager) EmbedBuilder(net.dv8tion.jda.core.EmbedBuilder)

Aggregations

MusicManager (fun.rubicon.core.music.MusicManager)3 UserSQL (fun.rubicon.sql.UserSQL)2 EmbedBuilder (net.dv8tion.jda.core.EmbedBuilder)1 Message (net.dv8tion.jda.core.entities.Message)1