diff --git a/build.gradle b/build.gradle index 99ef2483..2720c5fb 100644 --- a/build.gradle +++ b/build.gradle @@ -26,10 +26,16 @@ plugins { id "nu.studer.jooq" version "8.0" id 'maven-publish' id "gg.jte.gradle" version "3.1.6" +// id "nebula.lint" version "19.0.3" } apply plugin: "kotlin" apply plugin: 'java' +//apply plugin: "nebula.lint" + +//gradleLint { +// rules=['unused-dependency'] +//} group 'link.locutus' version '1.0-SNAPSHOT' @@ -96,11 +102,9 @@ dependencies { implementation 'com.amazonaws:aws-java-sdk-bom:1.12.649' implementation 'com.amazonaws:aws-java-sdk-s3:1.12.649' + implementation 'org.apache.logging.log4j:log4j-core:2.23.1' + implementation 'org.apache.logging.log4j:log4j-api:2.13.3' - testImplementation 'org.hsqldb:hsqldb:2.7.2' - - implementation 'org.apache.logging.log4j:log4j-core:2.19.0' - implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.19.0' implementation 'com.pusher:pusher-java-client:2.4.4' @@ -108,7 +112,7 @@ dependencies { implementation 'com.google.http-client:google-http-client-jackson2:1.43.3' - implementation('org.xerial:sqlite-jdbc:3.41.2.2') + implementation('org.xerial:sqlite-jdbc:3.46.1.0') implementation 'com.google.code.gson:gson:2.8.9' implementation 'org.jsoup:jsoup:1.12.1' implementation 'org.bitbucket.cowwoc:diff-match-patch:1.2' @@ -139,42 +143,37 @@ dependencies { implementation 'com.google.apis:google-api-services-drive:v3-rev20220815-2.0.0' implementation 'com.google.apis:google-api-services-docs:v1-rev20220609-2.0.0' implementation 'de.erichseifert.gral:gral-core:0.11' -// https://mvnrepository.com/artifact/org.apache.commons/commons-math3 - implementation 'org.apache.commons:commons-math3:3.6.1' - implementation 'org.kefirsf:kefirbb:1.5' implementation ('com.inversoft:prime-transformer:2.1.4') { exclude group: 'org.freemarker' } - // https://mvnrepository.com/artifact/gnu.trove/trove - implementation group: 'gnu.trove', name: 'trove', version: '3.0.3' // https://mvnrepository.com/artifact/it.unimi.dsi/fastutil implementation group: 'it.unimi.dsi', name: 'fastutil', version: '8.2.1' // https://mvnrepository.com/artifact/com.opencsv/opencsv implementation group: 'com.opencsv', name: 'opencsv', version: '3.7' - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" +// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation 'in.wilsonl.minifyhtml:minify-html:0.15.0' // implementation "org.springframework.boot:spring-boot-starter-web:2.4.4" // implementation "org.springframework.boot:spring-boot-starter-data-mongodb:2.4.4" implementation "com.graphql-java-kickstart:graphql-spring-boot-starter:11.1.0" - implementation "com.graphql-java-kickstart:graphiql-spring-boot-starter:11.1.0" +// implementation "com.graphql-java-kickstart:graphiql-spring-boot-starter:11.1.0" // implementation 'org.springframework:spring-web:6.1.3' - implementation "com.graphql-java:graphql-java-extended-scalars:16.0.1" +// implementation "com.graphql-java:graphql-java-extended-scalars:16.0.1" implementation "io.github.kobylynskyi:graphql-java-codegen:5.4.0" implementation "org.apache.httpcomponents:httpclient:4.5.13" implementation "javax.validation:validation-api:2.0.1.Final" - implementation "org.mapstruct:mapstruct:1.4.2.Final" - annotationProcessor "org.mapstruct:mapstruct-processor:1.4.2.Final" +// implementation "org.mapstruct:mapstruct:1.4.2.Final" +// annotationProcessor "org.mapstruct:mapstruct-processor:1.4.2.Final" implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.17.2' // https://mvnrepository.com/artifact/de.siegmar/fastcsv @@ -193,11 +192,11 @@ dependencies { implementation("com.theokanning.openai-gpt3-java:service:0.18.2") implementation("com.theokanning.openai-gpt3-java:api:0.18.2") - implementation 'com.github.javaparser:javaparser-symbol-solver-core:3.25.3' - implementation 'com.github.javaparser:javaparser-core:3.25.3' +// implementation 'com.github.javaparser:javaparser-symbol-solver-core:3.25.3' +// implementation 'com.github.javaparser:javaparser-core:3.25.3' implementation 'com.knuddels:jtokkit:0.6.1' // https://mvnrepository.com/artifact/org.tensorflow/tensorflow - implementation 'org.tensorflow:tensorflow:1.15.0' +// implementation 'org.tensorflow:tensorflow:1.15.0' // implementation 'org.apache.commons:commons-lang3:3.12.0' // https://mvnrepository.com/artifact/org.apache.commons/commons-text // implementation 'org.apache.commons:commons-text:1.10.0' @@ -210,7 +209,7 @@ dependencies { runtimeOnly 'ai.djl.pytorch:pytorch-native-cu121:2.2.2:win-x86_64' runtimeOnly 'ai.djl.pytorch:pytorch-jni:2.2.2-0.28.0' // implementation 'net.sourceforge.tess4j:tess4j:4.5.1' - implementation 'org.bytedeco:javacv:1.5.6' +// implementation 'org.bytedeco:javacv:1.5.6' implementation 'cn.easyproject:easyocr:3.0.4-RELEASE' implementation 'com.vdurmont:emoji-java:5.1.1' implementation 'info.debatty:java-string-similarity:2.0.0' @@ -436,6 +435,7 @@ sourceSets { srcDirs "$buildDir/generated-sources" } resources { + srcDirs "src/main/resources/log" srcDirs "src/main/resources/css" srcDirs "src/main/resources/js" srcDirs "src/main/resources/img" @@ -465,7 +465,7 @@ jar { } shadowJar { -// minimize() + minimize() zip64=true archiveBaseName = "${name}-${project.name}" } diff --git a/src/main/java/link/locutus/discord/Locutus.java b/src/main/java/link/locutus/discord/Locutus.java index c9fc2727..995eccf9 100644 --- a/src/main/java/link/locutus/discord/Locutus.java +++ b/src/main/java/link/locutus/discord/Locutus.java @@ -87,6 +87,7 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.core.LoggerContext; +import org.apache.logging.log4j.core.async.AsyncLoggerContextSelector; import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.LoggerConfig; import org.jetbrains.annotations.NotNull; @@ -147,20 +148,8 @@ public static synchronized Locutus create() { } } - private void setInfoLogging() { -// org.apache.log4j.Logger.getRootLogger().setLevel(Level.INFO); -// Configurator.setRootLevel(org.apache.logging.log4j.Level.INFO); - LoggerContext ctx = (LoggerContext) LogManager.getContext(false); - Configuration config = ctx.getConfiguration(); - LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME); - loggerConfig.setLevel(Level.INFO); - ctx.updateLoggers(); -// ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) org.slf4j.LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME); -// root.setLevel(ch.qos.logback.classic.Level.INFO); - } - private Locutus() throws SQLException, ClassNotFoundException, LoginException, InterruptedException, NoSuchMethodException { - setInfoLogging(); + Logg.setInfoLogging(); if (INSTANCE != null) throw new IllegalStateException("Already running."); INSTANCE = this; diff --git a/src/main/java/link/locutus/discord/Logg.java b/src/main/java/link/locutus/discord/Logg.java new file mode 100644 index 00000000..49ebe205 --- /dev/null +++ b/src/main/java/link/locutus/discord/Logg.java @@ -0,0 +1,49 @@ +package link.locutus.discord; + + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.core.LoggerContext; +import org.apache.logging.log4j.core.async.AsyncLoggerContextSelector; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.Configurator; +import org.apache.logging.log4j.core.config.LoggerConfig; +import org.apache.logging.log4j.core.config.builder.api.*; +import org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration; + +public class Logg { + private static final Logger LOGGER; + + static { + LOGGER = LogManager.getLogger(Logg.class.getSimpleName()); + } + private static final boolean DEBUG = true; + + public static void text(Object obj) { +// System.out.println(obj); + LOGGER.error(obj); + } + + public static void text(String msg, Object... obj) { +// System.out.println(String.format(msg, obj)); + LOGGER.error(msg, obj); + } + + public static void setInfoLogging() { +// org.apache.log4j.Logger.getRootLogger().setLevel(Level.INFO); +// Configurator.setRootLevel(org.apache.logging.log4j.Level.INFO); + System.setProperty("Log4jContextSelector", AsyncLoggerContextSelector.class.getName()); + System.setProperty("log4j2.enable.threadlocals", "true"); // Enable garbage-free logging + System.setProperty("log4j2.contextSelector", "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector"); + + LoggerContext ctx = (LoggerContext) LogManager.getContext(false); + Configuration config = ctx.getConfiguration(); + LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME); + loggerConfig.setLevel(Level.INFO); + + ctx.updateLoggers(); +// ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) org.slf4j.LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME); +// root.setLevel(ch.qos.logback.classic.Level.INFO); + } +} \ No newline at end of file diff --git a/src/main/java/link/locutus/discord/apiv3/PoliticsAndWarV3.java b/src/main/java/link/locutus/discord/apiv3/PoliticsAndWarV3.java index 594afed2..675a101f 100644 --- a/src/main/java/link/locutus/discord/apiv3/PoliticsAndWarV3.java +++ b/src/main/java/link/locutus/discord/apiv3/PoliticsAndWarV3.java @@ -4,8 +4,6 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.gson.reflect.TypeToken; -import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import link.locutus.discord.Locutus; import link.locutus.discord.RequestTracker; @@ -14,8 +12,6 @@ import link.locutus.discord.apiv1.enums.TreatyType; import link.locutus.discord.apiv3.enums.AlliancePermission; import link.locutus.discord.config.Settings; -import link.locutus.discord.db.DiscordDB; -import link.locutus.discord.db.entities.DBAlliance; import link.locutus.discord.pnw.NationOrAlliance; import link.locutus.discord.util.*; import link.locutus.discord.util.StringMan; @@ -24,10 +20,7 @@ import link.locutus.discord.apiv1.core.ApiKeyPool; import graphql.GraphQLException; import link.locutus.discord.util.io.PagePriority; -import net.dv8tion.jda.api.entities.channel.concrete.Category; -import net.dv8tion.jda.api.requests.ErrorResponse; import org.apache.commons.lang3.StringUtils; -import org.springframework.http.HttpStatus; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; @@ -39,16 +32,13 @@ import org.springframework.web.client.RestTemplate; import java.net.URI; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; -import java.util.function.Supplier; import java.util.stream.Collectors; public class PoliticsAndWarV3 { diff --git a/src/main/java/link/locutus/discord/commands/manager/v2/impl/pw/commands/CustomSheetCommands.java b/src/main/java/link/locutus/discord/commands/manager/v2/impl/pw/commands/CustomSheetCommands.java index 5e4c7d1e..5da1cf5a 100644 --- a/src/main/java/link/locutus/discord/commands/manager/v2/impl/pw/commands/CustomSheetCommands.java +++ b/src/main/java/link/locutus/discord/commands/manager/v2/impl/pw/commands/CustomSheetCommands.java @@ -1,6 +1,5 @@ package link.locutus.discord.commands.manager.v2.impl.pw.commands; -import com.github.javaparser.printer.lexicalpreservation.Added; import link.locutus.discord.Locutus; import link.locutus.discord.commands.manager.v2.binding.ValueStore; import link.locutus.discord.commands.manager.v2.binding.annotation.Command; diff --git a/src/main/java/link/locutus/discord/config/yaml/Config.java b/src/main/java/link/locutus/discord/config/yaml/Config.java index ee9e195b..6276f79b 100644 --- a/src/main/java/link/locutus/discord/config/yaml/Config.java +++ b/src/main/java/link/locutus/discord/config/yaml/Config.java @@ -1,9 +1,10 @@ package link.locutus.discord.config.yaml; +import link.locutus.discord.Logg; import link.locutus.discord.util.StringMan; import link.locutus.discord.config.yaml.file.YamlConfiguration; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.io.ByteArrayOutputStream; import java.io.File; @@ -26,8 +27,6 @@ public class Config { - private static final Logger LOGGER = LoggerFactory.getLogger(Config.class.getSimpleName()); - public Config() { save(new PrintWriter(new ByteArrayOutputStream(0)), getClass(), this, 0); } @@ -48,7 +47,7 @@ private T get(String key, Class root) { } } } - LOGGER.error("Failed to get config option: {}", key); + Logg.text("Failed to get config option: {}", key); return null; } @@ -115,7 +114,7 @@ private void set(String key, Object value, Class root) { } } System.out.println("Failed to set config option: " + key + ": " + value + " | " + instance + " | " + root.getSimpleName() + ".yml"); - LOGGER.error("Failed to set config option: {}: {} | {} | {}.yml", key, value, instance, root.getSimpleName()); + Logg.text("Failed to set config option: {}: {} | {} | {}.yml", key, value, instance, root.getSimpleName()); } public boolean load(File file) { @@ -356,7 +355,7 @@ private Field getField(String[] split, Object instance) { setAccessible(field); return field; } catch (Throwable ignored) { - LOGGER.warn( + Logg.text( "Invalid config field: {} for {}", StringMan.join(split, "."), toNodeName(instance.getClass().getSimpleName()) diff --git a/src/main/java/link/locutus/discord/config/yaml/file/FileConfiguration.java b/src/main/java/link/locutus/discord/config/yaml/file/FileConfiguration.java index 4a252f44..e13ecaa4 100644 --- a/src/main/java/link/locutus/discord/config/yaml/file/FileConfiguration.java +++ b/src/main/java/link/locutus/discord/config/yaml/file/FileConfiguration.java @@ -1,5 +1,9 @@ package link.locutus.discord.config.yaml.file; +import it.unimi.dsi.fastutil.io.BinIO; +import it.unimi.dsi.fastutil.io.FastBufferedInputStream; +import it.unimi.dsi.fastutil.io.FastByteArrayOutputStream; +import link.locutus.discord.Logg; import link.locutus.discord.config.yaml.Configuration; import link.locutus.discord.config.yaml.InvalidConfigurationException; import link.locutus.discord.config.yaml.MemoryConfiguration; @@ -118,9 +122,19 @@ public void load(File file) throws IOException, InvalidConfigurationException { if (file == null) { throw new NullPointerException("File cannot be null"); } + long start = System.currentTimeMillis(); + try (FileInputStream stream = new FileInputStream(file); + InputStreamReader reader = new InputStreamReader(new FastBufferedInputStream(stream), StandardCharsets.UTF_8); + BufferedReader input = new BufferedReader(reader); + FastByteArrayOutputStream builder = new FastByteArrayOutputStream()) { - try (FileInputStream stream = new FileInputStream(file)) { - load(new InputStreamReader(stream, StandardCharsets.UTF_8)); + String line; + while ((line = input.readLine()) != null) { + builder.write(line.getBytes(StandardCharsets.UTF_8)); + builder.write('\n'); + } + String myStr = new String(builder.array, 0, builder.length, StandardCharsets.UTF_8); + loadFromString(myStr); } } @@ -138,9 +152,7 @@ public void load(File file) throws IOException, InvalidConfigurationException { * @throws IllegalArgumentException thrown when reader is null */ public void load(Reader reader) throws IOException, InvalidConfigurationException { - StringBuilder builder = new StringBuilder(); - try (BufferedReader input = reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader)) { String line; diff --git a/src/main/java/link/locutus/discord/config/yaml/file/YamlConfiguration.java b/src/main/java/link/locutus/discord/config/yaml/file/YamlConfiguration.java index 4a6a62b9..29a9490d 100644 --- a/src/main/java/link/locutus/discord/config/yaml/file/YamlConfiguration.java +++ b/src/main/java/link/locutus/discord/config/yaml/file/YamlConfiguration.java @@ -1,13 +1,15 @@ package link.locutus.discord.config.yaml.file; +import link.locutus.discord.Logg; import link.locutus.discord.config.yaml.Configuration; import link.locutus.discord.config.yaml.ConfigurationSection; import link.locutus.discord.config.yaml.InvalidConfigurationException; -import org.slf4j.LoggerFactory; -import org.slf4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.error.YAMLException; +import org.yaml.snakeyaml.introspector.PropertyUtils; import org.yaml.snakeyaml.representer.Representer; import java.io.File; @@ -23,11 +25,21 @@ */ public class YamlConfiguration extends FileConfiguration { - private static final Logger LOGGER = LoggerFactory.getLogger(YamlConfiguration.class.getSimpleName()); + private static final Logger LOGGER = LogManager.getLogger(YamlConfiguration.class.getSimpleName()); protected static final String COMMENT_PREFIX = "# "; protected static final String BLANK_CONFIG = "{}\n"; + private final DumperOptions yamlOptions = new DumperOptions(); private final Representer yamlRepresenter = new YamlRepresenter(); + { + yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); + yamlRepresenter.setPropertyUtils(new CustomPropertyUtils()); + } + public static class CustomPropertyUtils extends PropertyUtils { + public CustomPropertyUtils() { + this.setSkipMissingProperties(true); + } + } private final Yaml yaml = new Yaml(new YamlConstructor(), yamlRepresenter, yamlOptions); /** @@ -139,9 +151,13 @@ public void loadFromString(final String contents) throws InvalidConfigurationExc options().header(header); } + Logg.text("remove:||PERF set header " + (-start + (start = System.currentTimeMillis())) + "ms"); + if (input != null) { convertMapsToSections(input, this); } + + Logg.text("remove:||PERF convert maps to sections " + (-start + (start = System.currentTimeMillis())) + "ms"); } protected void convertMapsToSections(final Map input, final ConfigurationSection section) { diff --git a/src/main/java/link/locutus/discord/config/yaml/serialization/ConfigurationSerialization.java b/src/main/java/link/locutus/discord/config/yaml/serialization/ConfigurationSerialization.java index 8ef85843..732acd31 100644 --- a/src/main/java/link/locutus/discord/config/yaml/serialization/ConfigurationSerialization.java +++ b/src/main/java/link/locutus/discord/config/yaml/serialization/ConfigurationSerialization.java @@ -1,8 +1,8 @@ package link.locutus.discord.config.yaml.serialization; import link.locutus.discord.config.yaml.Configuration; -import org.slf4j.LoggerFactory; -import org.slf4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; @@ -16,7 +16,7 @@ */ public class ConfigurationSerialization { - private static final Logger LOGGER = LoggerFactory.getLogger(ConfigurationSerialization.class.getSimpleName()); + private static final Logger LOGGER = LogManager.getLogger(ConfigurationSerialization.class.getSimpleName()); public static final String SERIALIZED_TYPE_KEY = "=="; private static final Map> aliases = diff --git a/src/main/java/link/locutus/discord/db/NationDB.java b/src/main/java/link/locutus/discord/db/NationDB.java index 54b840ca..50c98357 100644 --- a/src/main/java/link/locutus/discord/db/NationDB.java +++ b/src/main/java/link/locutus/discord/db/NationDB.java @@ -12,6 +12,7 @@ import it.unimi.dsi.fastutil.objects.ObjectArraySet; import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; import link.locutus.discord.Locutus; +import link.locutus.discord.Logg; import link.locutus.discord.apiv1.domains.subdomains.SNationContainer; import link.locutus.discord.apiv1.enums.city.building.MilitaryBuilding; import link.locutus.discord.apiv3.csv.DataDumpParser; @@ -60,8 +61,6 @@ import link.locutus.discord.apiv1.enums.city.JavaCity; import link.locutus.discord.util.scheduler.ThrowingTriConsumer; import org.apache.commons.lang3.tuple.Triple; -import org.slf4j.LoggerFactory; -import org.slf4j.Logger; import java.io.IOException; import java.sql.PreparedStatement; @@ -81,7 +80,6 @@ import static com.google.common.base.Preconditions.checkNotNull; public class NationDB extends DBMainV2 implements SyncableDatabase { - private static final Logger LOGGER = LoggerFactory.getLogger(NationDB.class.getSimpleName()); private final Map nationsById = new Int2ObjectOpenHashMap<>(); private final Map> nationsByAlliance = new Int2ObjectOpenHashMap<>(); private final Map alliancesById = new Int2ObjectOpenHashMap<>(); @@ -128,7 +126,7 @@ private void condenseCities() { public void load() throws SQLException { { // Legacy if (tableExists("NATIONS")) { - LOGGER.info("Updating legacy nations"); + Logg.text("Updating legacy nations"); updateLegacyNations(); } if (tableExists("TREATIES")) getDb().drop("TREATIES"); @@ -136,15 +134,15 @@ public void load() throws SQLException { } loadPositions(); - LOGGER.info("Loaded " + positionsById.size() + " positions"); + Logg.text("Loaded " + positionsById.size() + " positions"); loadAlliances(); - LOGGER.info("Loaded " + alliancesById.size() + " alliances"); + Logg.text("Loaded " + alliancesById.size() + " alliances"); loadNations(); - LOGGER.info("Loaded " + nationsById.size() + " nations"); + Logg.text("Loaded " + nationsById.size() + " nations"); int cities = loadCities(); - LOGGER.info("Loaded " + cities + " cities"); + Logg.text("Loaded " + cities + " cities"); int treaties = loadTreaties(); - LOGGER.info("Loaded " + treaties + " treaties"); + Logg.text("Loaded " + treaties + " treaties"); try { if (tableExists("KICKS")) { diff --git a/src/main/java/link/locutus/discord/util/MarkupUtil.java b/src/main/java/link/locutus/discord/util/MarkupUtil.java index a0b97da1..eb252ebb 100644 --- a/src/main/java/link/locutus/discord/util/MarkupUtil.java +++ b/src/main/java/link/locutus/discord/util/MarkupUtil.java @@ -3,39 +3,27 @@ import com.vladsch.flexmark.ast.FencedCodeBlock; import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension; import com.vladsch.flexmark.html.HtmlRenderer; -import com.vladsch.flexmark.html.HtmlWriter; import com.vladsch.flexmark.html.renderer.NodeRenderer; -import com.vladsch.flexmark.html.renderer.NodeRendererContext; import com.vladsch.flexmark.html.renderer.NodeRendererFactory; import com.vladsch.flexmark.html.renderer.NodeRenderingHandler; import com.vladsch.flexmark.html2md.converter.FlexmarkHtmlConverter; -import com.vladsch.flexmark.html2md.converter.HtmlNodeRenderer; -import com.vladsch.flexmark.html2md.converter.HtmlNodeRendererFactory; -import com.vladsch.flexmark.html2md.converter.HtmlNodeRendererHandler; import com.vladsch.flexmark.parser.Parser; import com.vladsch.flexmark.util.ast.Node; import com.vladsch.flexmark.util.data.DataHolder; import com.vladsch.flexmark.util.data.MutableDataSet; import link.locutus.discord.Locutus; -import link.locutus.discord.commands.external.guild.KeyStore; import link.locutus.discord.commands.manager.v2.command.CommandCallable; import link.locutus.discord.commands.manager.v2.command.ParametricCallable; import link.locutus.discord.commands.manager.v2.impl.pw.CommandManager2; -import link.locutus.discord.db.entities.grant.TemplateTypes; import link.locutus.discord.util.discord.DiscordUtil; import link.locutus.discord.web.jooby.WebRoot; import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.MessageEmbed; import net.dv8tion.jda.api.entities.Role; -import net.dv8tion.jda.api.entities.channel.concrete.TextChannel; import net.dv8tion.jda.api.entities.channel.middleman.GuildChannel; import org.apache.commons.lang3.StringEscapeUtils; -import org.apache.http.NameValuePair; import org.apache.http.client.utils.URLEncodedUtils; import org.apache.http.message.BasicNameValuePair; -import org.kefirsf.bb.BBProcessorFactory; -import org.kefirsf.bb.ConfigurationFactory; -import org.kefirsf.bb.TextProcessor; import org.primeframework.transformer.domain.Document; import org.primeframework.transformer.service.BBCodeParser; import org.primeframework.transformer.service.BBCodeToHTMLTransformer;