From 985129fc7d22735d912efa2f663dd84f05519b60 Mon Sep 17 00:00:00 2001 From: Taz Date: Sun, 14 Aug 2022 14:06:49 +0530 Subject: [PATCH 1/3] fixed unknown class referenced --- .../src/main/java/org/togetherjava/tjbot/Application.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/src/main/java/org/togetherjava/tjbot/Application.java b/application/src/main/java/org/togetherjava/tjbot/Application.java index e0995470d4..16a881e958 100644 --- a/application/src/main/java/org/togetherjava/tjbot/Application.java +++ b/application/src/main/java/org/togetherjava/tjbot/Application.java @@ -20,7 +20,7 @@ * Main class of the application. Use {@link #main(String[])} to start an instance of it. *

* New commands can be created by implementing - * {@link net.dv8tion.jda.api.events.interaction.SlashCommandInteractionEvent} or extending + * {@link net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent} or extending * {@link org.togetherjava.tjbot.commands.SlashCommandAdapter}. They can then be registered in * {@link Features}. */ From deb8b429da816c1ab49b2583cc86371968e883c5 Mon Sep 17 00:00:00 2001 From: Taz Date: Sun, 14 Aug 2022 14:38:40 +0530 Subject: [PATCH 2/3] fixed unknown class referenced --- .../main/java/org/togetherjava/tjbot/Application.java | 9 +++++++-- .../tjbot/commands/componentids/ComponentId.java | 1 + .../commands/componentids/ComponentIdGenerator.java | 9 +++++++-- .../tjbot/commands/componentids/ComponentIdParser.java | 6 +++++- .../tjbot/commands/componentids/ComponentIdStore.java | 4 +++- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/application/src/main/java/org/togetherjava/tjbot/Application.java b/application/src/main/java/org/togetherjava/tjbot/Application.java index 16a881e958..b9d98f44c5 100644 --- a/application/src/main/java/org/togetherjava/tjbot/Application.java +++ b/application/src/main/java/org/togetherjava/tjbot/Application.java @@ -3,14 +3,19 @@ import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDABuilder; import net.dv8tion.jda.api.requests.GatewayIntent; +import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import org.togetherjava.tjbot.commands.Features; import org.togetherjava.tjbot.commands.system.BotCore; import org.togetherjava.tjbot.config.Config; import org.togetherjava.tjbot.db.Database; +import org.togetherjava.tjbot.commands.SlashCommandAdapter; import javax.security.auth.login.LoginException; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -20,8 +25,8 @@ * Main class of the application. Use {@link #main(String[])} to start an instance of it. *

* New commands can be created by implementing - * {@link net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent} or extending - * {@link org.togetherjava.tjbot.commands.SlashCommandAdapter}. They can then be registered in + * {@link SlashCommandInteractionEvent} or extending + * {@link SlashCommandAdapter}. They can then be registered in * {@link Features}. */ public enum Application { diff --git a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentId.java b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentId.java index 49596eec7f..c5205e258b 100644 --- a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentId.java +++ b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentId.java @@ -1,6 +1,7 @@ package org.togetherjava.tjbot.commands.componentids; import org.jetbrains.annotations.NotNull; +import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; import java.util.List; diff --git a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdGenerator.java b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdGenerator.java index 41b9ef0a3c..5568d95d7f 100644 --- a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdGenerator.java +++ b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdGenerator.java @@ -3,6 +3,11 @@ import net.dv8tion.jda.api.entities.Emoji; import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; import net.dv8tion.jda.api.interactions.components.ComponentInteraction; +import net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle; +import net.dv8tion.jda.api.interactions.components.buttons.Button; + +import org.togetherjava.tjbot.commands.SlashCommand; + import org.jetbrains.annotations.NotNull; /** @@ -12,7 +17,7 @@ * are persisted by the system. *

* See - * {@link org.togetherjava.tjbot.commands.SlashCommand#onSlashCommand(SlashCommandInteractionEvent)} + * {@link SlashCommand#onSlashCommand(SlashCommandInteractionEvent)} * for more context on how to use this. *

* The interface {@link ComponentIdParser} is the counterpart to this, offering parsing back the @@ -25,7 +30,7 @@ public interface ComponentIdGenerator { * interactions, such as button or selection menus. *

* See {@link ComponentInteraction#getComponentId()} and - * {@link net.dv8tion.jda.api.interactions.components.Button#of(ButtonStyle, String, Emoji)} for + * {@link Button#of(ButtonStyle, String, Emoji)} for * details on where the generated ID can be used. * * @param componentId the component ID payload to persist and generate a valid ID for diff --git a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdParser.java b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdParser.java index e616592bd0..d19f097c49 100644 --- a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdParser.java +++ b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdParser.java @@ -2,6 +2,10 @@ import net.dv8tion.jda.api.entities.Emoji; import net.dv8tion.jda.api.interactions.components.ComponentInteraction; +import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; +import net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle; +import net.dv8tion.jda.api.interactions.components.buttons.Button; + import org.jetbrains.annotations.NotNull; import java.util.Optional; @@ -26,7 +30,7 @@ public interface ComponentIdParser { * interactions, such as button or selection menus. *

* See {@link ComponentInteraction#getComponentId()} and - * {@link net.dv8tion.jda.api.interactions.components.Button#of(ButtonStyle, String, Emoji)} for + * {@link Button#of(ButtonStyle, String, Emoji)} for * details on where the ID was originally transported with. * * @param uuid the UUID to parse which represents the component ID diff --git a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdStore.java b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdStore.java index f611d74be7..a73e042c3b 100644 --- a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdStore.java +++ b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdStore.java @@ -4,6 +4,8 @@ import com.fasterxml.jackson.dataformat.csv.CsvMapper; import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; +import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; +import org.togetherjava.tjbot.commands.SlashCommand; import org.jetbrains.annotations.NotNull; import org.jooq.Result; import org.slf4j.Logger; @@ -26,7 +28,7 @@ /** * Thread-safe storage for component IDs. Can put, persist and get back component IDs based on * UUIDs. Component IDs are used for button and selection menu commands, see - * {@link org.togetherjava.tjbot.commands.SlashCommand#onSlashCommand(SlashCommandInteractionEvent)} + * {@link SlashCommand#onSlashCommand(SlashCommandInteractionEvent)} * for details. *

* Use {@link #putOrThrow(UUID, ComponentId, Lifespan)} to put and persist a component ID; and From 8fedf0a1b3c558c5428c71efd19f4f23b2e31920 Mon Sep 17 00:00:00 2001 From: Taz Date: Sun, 14 Aug 2022 14:43:42 +0530 Subject: [PATCH 3/3] reformat --- .../main/java/org/togetherjava/tjbot/Application.java | 6 ++---- .../commands/componentids/ComponentIdGenerator.java | 9 ++++----- .../tjbot/commands/componentids/ComponentIdParser.java | 4 ++-- .../tjbot/commands/componentids/ComponentIdStore.java | 3 +-- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/application/src/main/java/org/togetherjava/tjbot/Application.java b/application/src/main/java/org/togetherjava/tjbot/Application.java index b9d98f44c5..9bcb011b33 100644 --- a/application/src/main/java/org/togetherjava/tjbot/Application.java +++ b/application/src/main/java/org/togetherjava/tjbot/Application.java @@ -24,10 +24,8 @@ /** * Main class of the application. Use {@link #main(String[])} to start an instance of it. *

- * New commands can be created by implementing - * {@link SlashCommandInteractionEvent} or extending - * {@link SlashCommandAdapter}. They can then be registered in - * {@link Features}. + * New commands can be created by implementing {@link SlashCommandInteractionEvent} or extending + * {@link SlashCommandAdapter}. They can then be registered in {@link Features}. */ public enum Application { ; diff --git a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdGenerator.java b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdGenerator.java index 5568d95d7f..7514983890 100644 --- a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdGenerator.java +++ b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdGenerator.java @@ -16,9 +16,8 @@ * Component IDs are used during button or selection menu events. They can carry arbitrary data and * are persisted by the system. *

- * See - * {@link SlashCommand#onSlashCommand(SlashCommandInteractionEvent)} - * for more context on how to use this. + * See {@link SlashCommand#onSlashCommand(SlashCommandInteractionEvent)} for more context on how to + * use this. *

* The interface {@link ComponentIdParser} is the counterpart to this, offering parsing back the * payload from the ID. @@ -30,8 +29,8 @@ public interface ComponentIdGenerator { * interactions, such as button or selection menus. *

* See {@link ComponentInteraction#getComponentId()} and - * {@link Button#of(ButtonStyle, String, Emoji)} for - * details on where the generated ID can be used. + * {@link Button#of(ButtonStyle, String, Emoji)} for details on where the generated ID can be + * used. * * @param componentId the component ID payload to persist and generate a valid ID for * @param lifespan the lifespan of the generated and persisted component ID diff --git a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdParser.java b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdParser.java index d19f097c49..5dbfcc4374 100644 --- a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdParser.java +++ b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdParser.java @@ -30,8 +30,8 @@ public interface ComponentIdParser { * interactions, such as button or selection menus. *

* See {@link ComponentInteraction#getComponentId()} and - * {@link Button#of(ButtonStyle, String, Emoji)} for - * details on where the ID was originally transported with. + * {@link Button#of(ButtonStyle, String, Emoji)} for details on where the ID was originally + * transported with. * * @param uuid the UUID to parse which represents the component ID * @return the payload associated to the given UUID, if empty the component ID either never diff --git a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdStore.java b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdStore.java index a73e042c3b..7d1de1d526 100644 --- a/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdStore.java +++ b/application/src/main/java/org/togetherjava/tjbot/commands/componentids/ComponentIdStore.java @@ -28,8 +28,7 @@ /** * Thread-safe storage for component IDs. Can put, persist and get back component IDs based on * UUIDs. Component IDs are used for button and selection menu commands, see - * {@link SlashCommand#onSlashCommand(SlashCommandInteractionEvent)} - * for details. + * {@link SlashCommand#onSlashCommand(SlashCommandInteractionEvent)} for details. *

* Use {@link #putOrThrow(UUID, ComponentId, Lifespan)} to put and persist a component ID; and * {@link #get(UUID)} to get it back. Component IDs are persisted during application runs and can