/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.techcavern.wavetact.commands.global;

import com.techcavern.wavetact.annot.CMD;
import com.techcavern.wavetact.utils.GeneralRegistry;
import com.techcavern.wavetact.utils.GeneralUtils;
import com.techcavern.wavetact.utils.GetUtils;
import com.techcavern.wavetact.utils.IRCUtils;
import com.techcavern.wavetact.utils.objects.GenericCommand;
import org.pircbotx.Channel;
import org.pircbotx.PircBotX;
import org.pircbotx.User;

/**
 * @author jztech101
 */
public class Disconnect extends GenericCommand {
    @CMD
    public Disconnect() {
        super(GeneralUtils.toArray("disconnect dc"), 20, "disconnect (r)");
    }

    @Override
    public void onCommand(User user, PircBotX Bot, Channel channel, boolean isPrivate,int UserPermLevel, String... args) throws Exception {
        if (args.length > 1 && args[0].equalsIgnoreCase("r")) {
            PircBotX botObject = Bot;
            IRCUtils.SendMessage(user, channel, "Reconnecting", isPrivate);
            botObject.stopBotReconnect();
            botObject.sendIRC().quitServer();
            Thread.sleep(20000);
            GeneralRegistry.WaveTact.addBot(botObject);
        }else {
            Bot.stopBotReconnect();
            Bot.sendIRC().quitServer();
        }
    }
}

@@ -801,12 +801,8 @@
 nect
- (r)
 %22);%0A
@@ -966,379 +966,8 @@
 n %7B%0A
-        if (args.length %3E 1 && args%5B0%5D.equalsIgnoreCase(%22r%22)) %7B%0A            PircBotX botObject = Bot;%0A            IRCUtils.SendMessage(user, channel, %22Reconnecting%22, isPrivate);%0A            botObject.stopBotReconnect();%0A            botObject.sendIRC().quitServer();%0A            Thread.sleep(20000);%0A            GeneralRegistry.WaveTact.addBot(botObject);%0A        %7Delse %7B%0A
     
@@ -1042,18 +1042,8 @@
 ();%0A
-        %7D%0A
     

Remove reconnect altogether