Program: 79567
Project: 79567
Buggy source:
@Command(name="String_Node_Str",desc="String_Node_Str",guildOnly=true,aliases={"String_Node_Str","String_Node_Str"},perms={"String_Node_Str","String_Node_Str"},usage="String_Node_Str",thread=true) public void cmdPurge(Context ctx){
  if (bot.isSelfbot()) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  if (ctx.rawArgs.length() < 1) {
    ctx.send(PURGE_NO_PARAMS).queue();
    return;
  }
  if (!ctx.guild.getSelfMember().hasPermission((Channel)ctx.channel,Permission.MESSAGE_MANAGE)) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  ctx.channel.sendTyping().queue();
  Matcher matcher;
  String args=ctx.rawArgs;
  String regex=null;
  List<String> substrings=new LinkedList<>();
  TLongList userIds=new TLongLinkedList();
  int limit=0;
  TextChannel channel=ctx.event.getTextChannel();
  args=match(PURGE_QUOTE_PATTERN,args,m -> {
    substrings.add(m.group(1).toLowerCase().trim());
  }
);
  matcher=PURGE_REGEX_PATTERN.matcher(args);
  if (matcher.find())   regex=matcher.group(1);
  args=match(PURGE_MENTION_PATTERN,args,m -> {
    userIds.add(MiscUtil.parseSnowflake(m.group(1)));
  }
);
  matcher=PURGE_NUM_PATTERN.matcher(args);
  if (matcher.find()) {
    try {
      limit=Integer.parseInt(matcher.group(1).trim());
    }
 catch (    NumberFormatException e) {
      ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
      return;
    }
  }
  args=args.replaceAll(PURGE_NUM_PATTERN.pattern(),"String_Node_Str");
  if (limit > 500 || limit < 2) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  boolean bots=args.contains("String_Node_Str");
  boolean embeds=args.contains("String_Node_Str");
  boolean links=args.contains("String_Node_Str");
  boolean attachments=args.contains("String_Node_Str");
  boolean none=substrings.isEmpty() && regex == null && userIds.isEmpty() && !bots && !embeds && !links && !attachments;
  String twoWeekWarn="String_Node_Str";
  OffsetDateTime maxAge=ctx.message.getCreationTime().minusWeeks(2).plusMinutes(1);
  List<Message> toDelete=new LinkedList<>();
  for (  Message msg : channel.getIterableHistory()) {
    if (toDelete.size() >= limit)     break;
    if (msg.getIdLong() == ctx.message.getIdLong())     continue;
    if (msg.getCreationTime().isBefore(maxAge)) {
      twoWeekWarn="String_Node_Str";
      break;
    }
    if (none || userIds.contains(msg.getAuthor().getIdLong()) || (bots && msg.getAuthor().isBot())|| (embeds && !msg.getEmbeds().isEmpty())|| (attachments && !msg.getAttachments().isEmpty())|| (links && PURGE_LINK_PATTERN.matcher(msg.getRawContent()).find())) {
      toDelete.add(msg);
      continue;
    }
    if (substrings.stream().anyMatch(ss -> msg.getRawContent().contains(ss))) {
      toDelete.add(msg);
      continue;
    }
    try {
      if (regex != null && msg.getRawContent().matches(regex))       toDelete.add(msg);
    }
 catch (    PatternSyntaxException e) {
      ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
      return;
    }
  }
  if (toDelete.isEmpty()) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
 else   if (toDelete.size() < 2) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  if (toDelete.size() <= 100) {
    channel.deleteMessages(toDelete).complete();
  }
 else {
    for (int i=0; i <= toDelete.size(); i+=100) {
      List<Message> list=toDelete.subList(i,Math.min(i + 100,toDelete.size()));
      if (list.isEmpty())       break;
      channel.deleteMessages(list).complete();
    }
  }
  ctx.send(Emotes.getSuccess() + "String_Node_Str" + toDelete.size()+ "String_Node_Str"+ twoWeekWarn).queue(msg -> {
    msg.delete().queueAfter(2,TimeUnit.SECONDS);
    ctx.message.addReaction("String_Node_Str").queue();
  }
);
}

Fixed version (ground truth):
@Command(name="String_Node_Str",desc="String_Node_Str",guildOnly=true,aliases={"String_Node_Str","String_Node_Str"},perms={"String_Node_Str","String_Node_Str"},usage="String_Node_Str",thread=true) public void cmdPurge(Context ctx){
  if (bot.isSelfbot()) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  if (ctx.rawArgs.length() < 1) {
    ctx.send(PURGE_NO_PARAMS).queue();
    return;
  }
  if (!ctx.guild.getSelfMember().hasPermission((Channel)ctx.channel,Permission.MESSAGE_MANAGE)) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  ctx.channel.sendTyping().queue();
  Matcher matcher;
  String args=ctx.rawArgs;
  String regex=null;
  List<String> substrings=new LinkedList<>();
  TLongList userIds=new TLongLinkedList();
  int limit=0;
  TextChannel channel=ctx.event.getTextChannel();
  args=match(PURGE_QUOTE_PATTERN,args,m -> {
    substrings.add(m.group(1).toLowerCase().trim());
  }
);
  matcher=PURGE_REGEX_PATTERN.matcher(args);
  if (matcher.find())   regex=matcher.group(1);
  args=match(PURGE_MENTION_PATTERN,args,m -> {
    userIds.add(MiscUtil.parseSnowflake(m.group(1)));
  }
);
  matcher=PURGE_NUM_PATTERN.matcher(args);
  if (matcher.find()) {
    try {
      limit=Integer.parseInt(matcher.group(1).trim());
    }
 catch (    NumberFormatException e) {
      ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
      return;
    }
  }
  args=args.replaceAll(PURGE_NUM_PATTERN.pattern(),"String_Node_Str");
  if (limit > 500 || limit < 2) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  boolean bots=args.contains("String_Node_Str");
  boolean embeds=args.contains("String_Node_Str");
  boolean links=args.contains("String_Node_Str");
  boolean attachments=args.contains("String_Node_Str");
  boolean none=substrings.isEmpty() && regex == null && userIds.isEmpty() && !bots && !embeds && !links && !attachments;
  String twoWeekWarn="String_Node_Str";
  OffsetDateTime maxAge=ctx.message.getCreationTime().minusWeeks(2).plusMinutes(1);
  List<Message> toDelete=new LinkedList<>();
  for (  Message msg : channel.getIterableHistory()) {
    if (toDelete.size() >= limit)     break;
    if (msg.getIdLong() == ctx.message.getIdLong())     continue;
    if (msg.getCreationTime().isBefore(maxAge)) {
      twoWeekWarn="String_Node_Str";
      break;
    }
    if (none || userIds.contains(msg.getAuthor().getIdLong()) || (bots && msg.getAuthor().isBot())|| (embeds && !msg.getEmbeds().isEmpty())|| (attachments && !msg.getAttachments().isEmpty())|| (links && PURGE_LINK_PATTERN.matcher(msg.getRawContent()).find())) {
      toDelete.add(msg);
      continue;
    }
    if (substrings.stream().anyMatch(ss -> msg.getRawContent().contains(ss))) {
      toDelete.add(msg);
      continue;
    }
    try {
      if (regex != null && msg.getRawContent().matches(regex))       toDelete.add(msg);
    }
 catch (    PatternSyntaxException e) {
      ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
      return;
    }
  }
  if (toDelete.isEmpty()) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
 else   if (toDelete.size() < 2) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  if (toDelete.size() <= 100) {
    channel.deleteMessages(toDelete).complete();
  }
 else {
    for (int i=0; i <= toDelete.size(); i+=99) {
      List<Message> list=toDelete.subList(i,Math.min(i + 99,toDelete.size()));
      if (list.isEmpty())       break;
      channel.deleteMessages(list).complete();
    }
  }
  ctx.send(Emotes.getSuccess() + "String_Node_Str" + toDelete.size()+ "String_Node_Str"+ twoWeekWarn).queue(msg -> {
    msg.delete().queueAfter(2,TimeUnit.SECONDS);
    ctx.message.addReaction("String_Node_Str").queue();
  }
);
}