@@ -0,0 +1,3445 @@
+package stream.flarebot.flarebot.commands.music;%0A%0Aimport com.arsenarsen.lavaplayerbridge.player.Track;%0Aimport net.dv8tion.jda.core.entities.Member;%0Aimport net.dv8tion.jda.core.entities.Message;%0Aimport net.dv8tion.jda.core.entities.TextChannel;%0Aimport net.dv8tion.jda.core.entities.User;%0Aimport org.joda.time.Period;%0Aimport org.joda.time.format.PeriodFormatter;%0Aimport org.joda.time.format.PeriodFormatterBuilder;%0Aimport stream.flarebot.flarebot.FlareBot;%0Aimport stream.flarebot.flarebot.commands.Command;%0Aimport stream.flarebot.flarebot.commands.CommandType;%0Aimport stream.flarebot.flarebot.objects.GuildWrapper;%0Aimport stream.flarebot.flarebot.util.MessageUtils;%0A%0Apublic class SeekCommand implements Command %7B%0A%0A    @Override%0A    public void onCommand(User sender, GuildWrapper guild, TextChannel channel, Message message, String%5B%5D args, Member member) %7B%0A        if (args.length == 1) %7B%0A            PeriodFormatter formatter = new PeriodFormatterBuilder()%0A                    .appendHours().appendSuffix(%22h%22)%0A                    .appendMinutes().appendSuffix(%22m%22)%0A                    .appendSeconds().appendSuffix(%22s%22)%0A                    .toFormatter();%0A            Period period;%0A            try %7B%0A                period = formatter.parsePeriod(args%5B0%5D);%0A            %7D catch (IllegalArgumentException e) %7B%0A                MessageUtils.sendErrorMessage(%22The duration is not in the correct format!%22, channel);%0A                return;%0A            %7D%0A            long millis = period.toStandardDuration().getMillis();%0A            Track t = FlareBot.getInstance().getMusicManager().getPlayer(guild.getGuildId()).getPlayingTrack();%0A            if (t == null) %7B%0A                MessageUtils.sendErrorMessage(%22There is no song currently playing!%22, channel);%0A                return;%0A            %7D else %7B%0A                if (t.getTrack().getInfo().isStream) %7B%0A                    MessageUtils.sendErrorMessage(%22Cannot seek on a livestream!%22, channel);%0A                    return;%0A                %7D else if (!t.getTrack().isSeekable()) %7B%0A                    MessageUtils.sendErrorMessage(%22Cannot seek on this track!%22, channel);%0A                    return;%0A                %7D else %7B%0A                    if (millis %3E= t.getTrack().getDuration()) %7B%0A                        MessageUtils.sendErrorMessage(%22The duration specified is bigger than the length of the video!%22, channel);%0A                        return;%0A                    %7D else %7B%0A                        t.getTrack().setPosition(millis);%0A                        PeriodFormatter niceFormatter = new PeriodFormatterBuilder()%0A                                .appendHours().appendSuffix(%22 Hours%22)%0A                                .appendMinutes().appendSuffix(%22 Minutes%22)%0A                                .appendSeconds().appendSuffix(%22 Seconds%22)%0A                                .toFormatter();%0A                        MessageUtils.sendSuccessMessage(%22The track has been skipped to: %22 + period.toString(niceFormatter), channel);%0A                        return;%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A        MessageUtils.sendUsage(this, channel, sender);%0A    %7D%0A%0A    @Override%0A    public String getCommand() %7B%0A        return %22seek%22;%0A    %7D%0A%0A    @Override%0A    public String getDescription() %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public String getUsage() %7B%0A        return %22%22;%0A    %7D%0A%0A    @Override%0A    public CommandType getType() %7B%0A        return CommandType.MUSIC;%0A    %7D%0A%7D%0A

Add command to seek to a specific place