package stream.flarebot.flarebot.mod;

import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.entities.MessageEmbed;
import net.dv8tion.jda.core.entities.User;

import java.awt.Color;

public class Punishment {

    private EPunishment punishment;
    private long duration;

    public Punishment(EPunishment punishment) {
        this.punishment = punishment;
    }

    public Punishment(EPunishment punishment, int duration) {
        this.punishment = punishment;
        this.duration = duration;
    }

    public long getDuration() {
        return this.duration;
    }

    public String getName() {
        return punishment.name().charAt(0) + punishment.name().substring(1).toLowerCase().replaceAll("_", " ");
    }

    public EPunishment getPunishment() {
        return punishment;
    }

    public MessageEmbed getPunishmentEmbed(User user, User responsible, String reason) {
        EmbedBuilder eb = new EmbedBuilder();
        eb.setTitle("FlareBot ModLog");
        eb.setColor(Color.WHITE);
        eb.addField("User", "`" + user.getName() + "#" + user.getDiscriminator() + "`", true);
        eb.addField("User ID", "`" + user.getId() + "`", true);
        if(responsible != null)
            eb.addField("Responsible", responsible.getAsMention(), true);
        String action = null;
        switch (punishment) {
            case PURGE:
                action = "Purge";
                break;
            case TEMP_MUTE:
                action = "Temp Mute";
                break;
            case MUTE:
                action = "Mute";
                break;
            case KICK:
                action = "Kick";
                break;
            case TEMP_BAN:
                action = "Temp Ban";
                break;
            case BAN:
                action = "Ban";
                break;
        }
        eb.addField("Action", action, true).addField("Reason", (reason != null ? reason : "No reason given!"), true);
        return eb.build();
    }

    public enum EPunishment {
        PURGE,
        TEMP_MUTE,
        MUTE,
        KICK,
        TEMP_BAN,
        BAN
    }
}

@@ -970,25 +970,28 @@
 tle(
-%22FlareBot ModLog%22
+punishment.getName()
 );%0A 
@@ -1050,22 +1050,16 @@
 (%22User%22,
- %22%60%22 +
  user.ge
@@ -1105,52 +1105,10 @@
  + %22
-%60%22, true);%0A        eb.addField(%22User ID%22, %22%60
+ (
 %22 + 
@@ -1127,9 +1127,9 @@
  + %22
-%60
+)
 %22, t
@@ -1202,16 +1202,26 @@
 ponsible
+ moderator
 %22, respo
@@ -1262,605 +1262,10 @@
     
-String action = null;%0A        switch (punishment) %7B%0A            case PURGE:%0A                action = %22Purge%22;%0A                break;%0A            case TEMP_MUTE:%0A                action = %22Temp Mute%22;%0A                break;%0A            case MUTE:%0A                action = %22Mute%22;%0A                break;%0A            case KICK:%0A                action = %22Kick%22;%0A                break;%0A            case TEMP_BAN:%0A                action = %22Temp Ban%22;%0A                break;%0A            case BAN:%0A                action = %22Ban%22;%0A                break;%0A        %7D%0A        eb.addField(%22Action%22, action, true)
+eb
 .add

Improve modlog