/*
 * Skybot, a multipurpose discord bot
 *      Copyright (C) 2017 - 2019  Duncan "duncte123" Sterken & Ramid "ramidzkh" Khan
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package ml.duncte123.skybot.commands.fun;

import ml.duncte123.skybot.Author;
import ml.duncte123.skybot.Settings;
import ml.duncte123.skybot.objects.command.Command;
import ml.duncte123.skybot.objects.command.CommandCategory;
import ml.duncte123.skybot.objects.command.CommandContext;
import org.jetbrains.annotations.NotNull;

import static me.duncte123.botcommons.messaging.MessageUtils.sendMsg;

@Author(nickname = "duncte123", author = "Duncan Sterken")
public class YodaSpeakCommand extends Command {
    @Override
    public void executeCommand(@NotNull CommandContext ctx) {
        sendMsg(ctx.getEvent(), "This command has been disabled due to technical issues");
    }

    @Override
    public String help() {
        return "Convert your sentences into yoda speak.\n" +
            "Usage: `" + Settings.PREFIX + getName() + " <A sentence.>`";
    }

    @Override
    public String getName() {
        return "yoda";
    }

    @Override
    public CommandCategory getCategory() {
        return CommandCategory.FUN;
    }
}

@@ -838,16 +838,225 @@
 s.fun;%0A%0A
+import me.duncte123.botcommons.web.WebUtils;%0Aimport me.duncte123.botcommons.web.WebUtils.EncodingType;%0Aimport me.duncte123.botcommons.web.WebUtilsErrorUtils;%0Aimport me.duncte123.weebJava.helpers.QueryBuilder;%0A
 import m
@@ -1082,16 +1082,16 @@
 Author;%0A
-
 import m
@@ -1290,16 +1290,92 @@
 ontext;%0A
+import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent;%0A
 import o
@@ -1663,24 +1663,25 @@
  ctx) %7B%0A
+%0A
         
 sendMsg(
@@ -1676,90 +1676,1008 @@
     
-sendMsg(ctx.getEvent(), %22This command has been disabled due to technical issues%22);
+final GuildMessageReceivedEvent event = ctx.getEvent();%0A%0A        if (ctx.getArgs().isEmpty()) %7B%0A            sendMsg(event, %22Correct usage: %60%22 + Settings.PREFIX + getName() + %22 %3CA sentence.%3E%60%22);%0A            return;%0A        %7D%0A%0A        final QueryBuilder builder = new QueryBuilder()%0A            .append(%22https://apis.duncte123.me/yoda%22)%0A            .append(%22sentence%22, ctx.getArgsDisplay())%0A            .append(%22token%22, event.getJDA().getToken());%0A%0A        WebUtils.ins.prepareRaw(WebUtils.defaultRequest()%0A            .url(builder.build())%0A            .addHeader(%22Accept%22, EncodingType.APPLICATION_JSON.getType())%0A            .build(), WebUtilsErrorUtils::toJSONObject).async(%0A            (json) -%3E %7B%0A                logger.debug(%22Yoda response: %22 + json);%0A                sendMsg(event, json.getString(%22data%22));%0A            %7D,%0A            error -%3E %7B%0A                error.printStackTrace();%0A                sendMsg(event, %22Yoda is asleep tell my developers to wake him up%22);%0A            %7D%0A        );%0A
 %0A   

Fix yoda command