package com.techcavern.wavetact.commands.utils;

import com.techcavern.wavetact.annot.CMD;
import com.techcavern.wavetact.objects.Command;
import com.techcavern.wavetact.utils.GeneralUtils;
import com.techcavern.wavetact.utils.PermUtils;
import org.pircbotx.hooks.events.MessageEvent;

public class CheckUserLevel extends Command {

    @CMD
    public CheckUserLevel() {
        super(GeneralUtils.toArray("checkuserlevel level checklevel"), 0, "Checks User Level, 0 arguments");
    }

    @Override
    public void onCommand(MessageEvent<?> event, String... args) throws Exception {
        int i = PermUtils.getPermLevel(event.getBot(), event.getUser(), event.getChannel());
        if (i == 9001) {
            event.respond("You are my Master!");
        } else if (i == 15) {
            event.respond("You are a Channel Owner!");

        } else if (i == 10) {
            event.respond("You are a Channel Operator!");
        } else if (i == 5) {
            event.respond("You are a Trusted User!");
        } else {
            event.respond("You are a Regular User!");
        }
    }
}

@@ -220,25 +220,98 @@
 t.utils.
-PermUtils
+IRCUtils;%0Aimport com.techcavern.wavetact.utils.PermUtils;%0Aimport org.pircbotx.User
 ;%0Aimport
@@ -652,16 +652,188 @@
 ption %7B%0A
+        User u;%0A        if(args.length %3C 1)%7B%0A            u = event.getUser();%0A        %7Delse%7B%0A            u = IRCUtils.getUserByNick(event.getChannel(),args%5B0%5D);%0A        %7D%0A%0A
         
@@ -879,31 +879,17 @@
 tBot(), 
-event.getUser()
+u
 , event.
@@ -950,28 +950,38 @@
 ent.respond(
-%22You
+u.getNick()+ %22
  are my Mast
@@ -1035,36 +1035,46 @@
   event.respond(
-%22You
+u.getNick()+ %22
  are a Channel O
@@ -1135,28 +1135,38 @@
 ent.respond(
-%22You
+u.getNick()+ %22
  are a Chann
@@ -1232,28 +1232,38 @@
 ent.respond(
-%22You
+u.getNick()+ %22
  are a Trust
@@ -1321,12 +1321,22 @@
 ond(
-%22You
+u.getNick()+ %22
  are

Allow arguments