@@ -0,0 +1,3397 @@
+package com.blamejared.mcbot.commands;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0Aimport java.net.URL;%0Aimport java.util.List;%0A%0Aimport org.apache.commons.io.IOUtils;%0A%0Aimport com.blamejared.mcbot.MCBot;%0Aimport com.blamejared.mcbot.commands.api.Argument;%0Aimport com.blamejared.mcbot.commands.api.Command;%0Aimport com.blamejared.mcbot.commands.api.CommandBase;%0Aimport com.blamejared.mcbot.commands.api.CommandContext;%0Aimport com.blamejared.mcbot.commands.api.CommandException;%0Aimport com.blamejared.mcbot.commands.api.Flag;%0Aimport com.blamejared.mcbot.util.Requirements;%0Aimport com.blamejared.mcbot.util.Requirements.RequiredType;%0Aimport com.google.common.base.Charsets;%0Aimport com.google.common.collect.Lists;%0A%0Aimport sx.blah.discord.handle.obj.Permissions;%0Aimport sx.blah.discord.util.MessageHistory;%0Aimport sx.blah.discord.util.RequestBuffer;%0Aimport sx.blah.discord.util.RequestBuilder;%0Aimport sx.blah.discord.util.RequestBuffer.IRequest;%0A%0A@Command%0Apublic class CommandInfoChannel extends CommandBase %7B%0A%0A    private static final Flag FLAG_REPLACE = new SimpleFlag(%22replace%22, %22Replace the current contents of the channel.%22, false);%0A    %0A    private static final Argument%3CString%3E ARG_URL = new WordArgument(%22url%22, %22The url to load the content from%22, true);%0A%0A    public CommandInfoChannel() %7B%0A        super(%22info%22, false, Lists.newArrayList(FLAG_REPLACE), Lists.newArrayList(ARG_URL));%0A    %7D%0A%0A    @Override%0A    public void process(CommandContext ctx) throws CommandException %7B%0A        try %7B%0A            ctx.getChannel().setTypingStatus(true);%0A            URL url = new URL(ctx.getArg(ARG_URL));%0A            List%3CString%3E lines = IOUtils.readLines(new InputStreamReader(url.openConnection().getInputStream(), Charsets.UTF_8));%0A            RequestBuilder builder = new RequestBuilder(MCBot.instance).shouldBufferRequests(true).doAction(() -%3E true);%0A            if (ctx.hasFlag(FLAG_REPLACE)) %7B%0A                MessageHistory history = RequestBuffer.request((IRequest%3CMessageHistory%3E) () -%3E ctx.getChannel().getFullMessageHistory()).get();%0A                for (int i = 0; i %3C history.size(); i++) %7B%0A                    final int idx = i;%0A                    builder.andThen(() -%3E %7B%0A                        history.get(idx).delete();%0A                        return true;%0A                    %7D);%0A                %7D%0A            %7D%0A            StringBuilder sb = new StringBuilder();%0A            for (String s : lines) %7B%0A                if (s.equals(%22=%3E%22)) %7B%0A                    final String msg = sb.toString();%0A                    builder.andThen(() -%3E %7B%0A                        ctx.reply(msg);%0A                        return true;%0A                    %7D);%0A                    sb = new StringBuilder();%0A                %7D else %7B%0A                    sb.append(s + %22%5Cn%22);%0A                %7D%0A            %7D%0A            builder.andThen(() -%3E %7B%0A                ctx.getMessage().delete();%0A                return true;%0A            %7D);%0A            builder.execute();%0A%0A            ctx.getChannel().setTypingStatus(false);%0A        %7D catch (IOException e) %7B%0A            throw new CommandException(e);%0A        %7D%0A    %7D%0A    %0A    @Override%0A    public String getDescription() %7B%0A        return %22Loads messages in a channel from a URL.%22;%0A    %7D%0A    %0A    @Override%0A    public Requirements requirements() %7B%0A        return Requirements.builder().with(Permissions.ADMINISTRATOR, RequiredType.ALL_OF).build();%0A    %7D%0A%7D%0A

Add info command