diff --git a/application/src/main/java/org/togetherjava/tjbot/Application.java b/application/src/main/java/org/togetherjava/tjbot/Application.java index e0995470d4..9bcb011b33 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; @@ -19,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 net.dv8tion.jda.api.events.interaction.SlashCommandInteractionEvent} or extending - * {@link org.togetherjava.tjbot.commands.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/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..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 @@ -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; /** @@ -11,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 org.togetherjava.tjbot.commands.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. @@ -25,8 +29,8 @@ 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 - * 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 e616592bd0..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 @@ -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,8 +30,8 @@ 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 - * 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 f611d74be7..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 @@ -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,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 org.togetherjava.tjbot.commands.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