package com.newhive.scammerradar.commands.subcommands;

import com.newhive.scammerradar.ScammerRadarAddon;
import com.newhive.scammerradar.config.ScammerRadarConfig;
import net.labymod.api.client.chat.command.SubCommand;

public class ShowSubCommand extends SubCommand {
   private final ScammerRadarAddon addon;

   public ShowSubCommand(ScammerRadarAddon addon) {
      super("show", new String[0]);
      this.addon = addon;
   }

   public boolean execute(String prefix, String[] arguments) {
      if (!(Boolean)((ScammerRadarConfig)this.addon.configuration()).enabled().get()) {
         return false;
      } else {
         try {
            this.addon.getHelper().displayNotification(this.addon.getHelper().showScammer());
         } catch (IllegalStateException e) {
            this.addon.getHelper().displayNotification(e.getMessage());
            this.addon.logger().error(e.getMessage(), new Object[0]);
         }

         return true;
      }
   }
}
