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;
}
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);
}
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;
}
Aggregations