package com.tisawesomeness.minecord.command.misc;

import com.tisawesomeness.minecord.Branding;
import com.tisawesomeness.minecord.command.CommandContext;

import lombok.NonNull;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.utils.MarkdownUtil;

public class CreditsCommand extends AbstractMiscCommand {

    public @NonNull String getId() {
        return "credits";
    }

    private final String DEVS = MarkdownUtil.maskedLink("Tis_awesomeness#8617", "https://github.com/Tisawesomeness") + " - Main Dev\n" +
        MarkdownUtil.maskedLink("jbs#6969", "https://github.com/lordjbs") + " - Developer\n" +
        MarkdownUtil.maskedLink("samueldcs#4675", "https://github.com/samueldcs") + " - Made the Website\n" +
        MarkdownUtil.maskedLink("DJ Electro#1677", "https://github.com/Electromaster232") + " - Helped with Git once";
    
    private final String APIS = "Discord API Wrapper - " + MarkdownUtil.maskedLink("JDA", "https://github.com/DV8FromTheWorld/JDA") + "\n" +
        "MC Account Info - " + MarkdownUtil.maskedLink("Mojang API", "https://wiki.vg/Mojang_API") + "\n" +
        "Skin Renders - " + MarkdownUtil.maskedLink("Crafatar", "https://crafatar.com") + "\n" +
        "Server Pinging - " + MarkdownUtil.maskedLink("MCServerPing", "https://github.com/lucaazalim/minecraft-server-ping") + "\n" +
        "Cape Sites - " +
            MarkdownUtil.maskedLink("Optifine", "https://optifine.net") + ", " +
            MarkdownUtil.maskedLink("LabyMod", "https://www.labymod.net") + ", " +
            MarkdownUtil.maskedLink("MinecraftCapes", "https://www.minecraftcapes.co.uk");

    public void run(String[] args, CommandContext ctx) {
        ctx.triggerCooldown();

        Branding branding = ctx.getBot().getBranding();
        String contrib = MarkdownUtil.maskedLink("Contribute on GitHub", branding.getGithub()) + "\n" +
                MarkdownUtil.maskedLink("Suggest features here", branding.getHelpServer());

        EmbedBuilder eb = new EmbedBuilder()
            .setTitle("Minecord Credits")
            .setColor(branding.getColor())
            .setDescription("Thanks to all these great people who helped to make the bot possible. :heart:")
            .addField("Developers", DEVS, true)
            .addField("Contribute", contrib, true)
            .addField("APIs Used", APIS, false);
        if (ctx.getConfig().isSelfHosted()) {
            String selfHost = "This bot is self-hosted by **" + branding.getAuthor() + "**\n" +
                    "Original Website - " + MarkdownUtil.maskedLink(Branding.WEBSITE, Branding.WEBSITE) + "\n" +
                    "Original Help Server - " + MarkdownUtil.maskedLink(Branding.HELP_SERVER, Branding.HELP_SERVER) + "\n" +
                    "Original Github - " + MarkdownUtil.maskedLink("Source Code", Branding.GITHUB);
            eb.addField("Self-Hosting", selfHost, false);
        }
        eb.setFooter("Website: " + branding.getWebsite());

        ctx.replyRaw(eb);
    }

}
@@ -527,32 +527,36 @@
 ev%5Cn%22 +%0A        
+    
 MarkdownUtil.mas
@@ -626,32 +626,36 @@
 er%5Cn%22 +%0A        
+   
+ 
 MarkdownUtil.mas
@@ -740,32 +740,36 @@
 te%5Cn%22 +%0A        
+    
 MarkdownUtil.mas
@@ -844,28 +844,24 @@
 %22 - 
-Helped with Git once
+Supplied Hosting
 %22;%0A 
@@ -1013,16 +1013,20 @@
         
+    
 %22MC Acco
@@ -1035,24 +1035,44 @@
 t Info - %22 +
+%0A                   
  MarkdownUti
@@ -1125,32 +1125,145 @@
 jang_API%22) +
+ %22, %22 +%0A                    MarkdownUtil.maskedLink(%22Electroid API%22, %22https://github.com/Electroid/mojang-api%22) +
  %22%5Cn%22 +%0A
         %22Ski
@@ -1242,32 +1242,36 @@
 -api%22) + %22%5Cn%22 +%0A
+    
         %22Skin Re
@@ -1343,32 +1343,36 @@
 .com%22) + %22%5Cn%22 +%0A
+    
         %22Server 
@@ -1501,37 +1501,33 @@
     
-%22Cape Sites - %22 +%0A           
+    %22Optifine Capes - %22 +
  Mar
@@ -1586,188 +1586,154 @@
 et%22)
- + %22, %22 +%0A            MarkdownUtil.maskedLink(%22LabyMod%22, %22https://www.labymod.net%22) + %22, %22 +%0A            MarkdownUtil.maskedLink(%22MinecraftCapes%22, %22https://www.minecraftcapes.co.uk
+;%0A%0A    private final String HOST = %22The public bot is proudly hosted by %22 + MarkdownUtil.maskedLink(%22Endless Hosting%22, %22https://theendlessweb.com/
 %22);%0A
@@ -2128,24 +2128,28 @@
             
+    
 .setTitle(%22M
@@ -2174,24 +2174,28 @@
             
+   
+ 
 .setColor(br
@@ -2213,16 +2213,20 @@
 olor())%0A
+    
         
@@ -2290,19 +2290,16 @@
  helped 
-to 
 make the
@@ -2323,16 +2323,20 @@
 eart:%22)%0A
+    
         
@@ -2379,32 +2379,36 @@
 ue)%0A            
+  
+  
 .addField(%22Contr
@@ -2422,32 +2422,36 @@
  contrib, true)%0A
+    
             .add
@@ -3034,19 +3034,242 @@
    %7D
-%0A        eb
+ else %7B%0A            eb.addField(%22Hosting%22, HOST, false);%0A        %7D%0A        String userMention = ctx.getE().getAuthor().getAsMention();%0A        eb.addField(%22Special Thanks%22, userMention + %22 for using Minecord!%22, false)%0A                
 .set
@@ -3283,17 +3283,18 @@
 %22Website
-:
+ -
  %22 + bra

Update &credits with recent changes