content: package commands.runnables.gimmickscategory;
  
  import java.util.Locale;
  import java.util.Random;
  import commands.Command;
  import commands.CommandEvent;
  import commands.listeners.CommandProperties;
  import core.EmbedFactory;
  import core.ExceptionLogger;
  import core.TextManager;
  import core.utils.EmbedUtil;
  import core.utils.StringUtil;
  import net.dv8tion.jda.api.EmbedBuilder;
  import org.jetbrains.annotations.NotNull;
  
  @CommandProperties(
          trigger = "roll",
          emoji = "\uD83C\uDFB2",
          executableWithoutArgs = true,
          aliases = { "dice", "diceroll" }
  )
  public class RollCommand extends Command {
  
      public RollCommand(Locale locale, String prefix) {
          super(locale, prefix);
      }
  
      @Override
      public boolean onTrigger(@NotNull CommandEvent event, @NotNull String args) {
          Random n = new Random();
          double drawn, border;
          boolean userMentioned = true;
  
          if (args.length() == 0 || !StringUtil.stringIsDouble(args)) {
              border = 6;
              userMentioned = false;
          } else {
              border = Double.parseDouble(args);
              if (border < 2) {
                  drawMessageNew(EmbedFactory.getEmbedError(this, TextManager.getString(getLocale(), TextManager.GENERAL, "too_small", "2")))
                          .exceptionally(ExceptionLogger.get());
                  return false;
              }
              if (border > 999999999999999999.0) {
                  drawMessageNew(EmbedFactory.getEmbedError(this, TextManager.getString(getLocale(), TextManager.GENERAL, "too_large", "999999999999999999")))
                          .exceptionally(ExceptionLogger.get());
                  return false;
              }
          }
  
          drawn = Math.floor(n.nextDouble() * border) + 1;
  
          EmbedBuilder eb = EmbedFactory.getEmbedDefault(
                  this,
                  getString("result", StringUtil.escapeMarkdown(event.getMember().getEffectiveName()), String.valueOf((long) drawn), String.valueOf((long) border))
          );
          if (!userMentioned) EmbedUtil.setFooter(eb, this, getString("noarg"));
          drawMessageNew(eb).exceptionally(ExceptionLogger.get());
          return true;
      }
  
  }
  