package com.blamejared.mcbot.commands;

import java.io.IOException;
import java.net.URL;

import org.apache.commons.io.IOUtils;

import com.blamejared.mcbot.commands.api.Command;
import com.blamejared.mcbot.commands.api.CommandBase;
import com.blamejared.mcbot.commands.api.CommandContext;
import com.blamejared.mcbot.commands.api.CommandException;
import com.google.common.base.Charsets;

@Command
public class CommandDrama extends CommandBase {

    public CommandDrama() {
        super("drama", false);
    }
    
    @Override
    public void process(CommandContext ctx) throws CommandException {
        try {
            String drama = IOUtils.readLines(new URL("http://ftb-drama.herokuapp.com/txt").openStream(), Charsets.UTF_8).get(0);
            ctx.replyBuffered(drama);
        } catch (IOException e) {
            throw new CommandException(e);
        }
    }
    
    @Override
    public String getDescription() {
        return "Creates some drama.";
    }
}

@@ -386,65 +386,481 @@
 ts;%0A
-%0A@Command%0Apublic class CommandDrama extends CommandBase %7B
+import com.google.gson.Gson;%0A%0Aimport lombok.Value;%0Aimport sx.blah.discord.api.internal.json.objects.EmbedObject;%0Aimport sx.blah.discord.util.EmbedBuilder;%0A%0A@Command%0Apublic class CommandDrama extends CommandBase %7B%0A    %0A    @Value%0A    private static class Drama %7B%0A        String drama;%0A        String version;%0A        String seed;%0A%0A        public String url() %7B%0A            return %22https://ftb-drama.herokuapp.com/%22 + this.getVersion() + %22/%22 + this.getSeed();%0A        %7D%0A    %7D
 %0A%0A  
@@ -1044,21 +1044,20 @@
  String 
-drama
+json
  = IOUti
@@ -1113,11 +1113,12 @@
 com/
-txt
+json
 %22).o
@@ -1170,31 +1170,372 @@
     
-ctx.replyBuffered(drama
+Drama drama = new Gson().fromJson(json, Drama.class);%0A            EmbedObject reply = new EmbedBuilder()%0A                    .withTitle(ctx.getAuthor().getDisplayName(ctx.getGuild()) + %22 started some drama!%22)%0A                    .withUrl(drama.url())%0A                    .withDesc(drama.getDrama())%0A                    .build();%0A            ctx.replyBuffered(reply
 );%0A 

Improve !drama