[AB-xxx] adding ability to track emotes used in reactions

adding ability to have confirmations for slash commands
This commit is contained in:
Sheldan
2025-01-27 01:31:56 +01:00
parent 2c3b16879e
commit ed42940e29
66 changed files with 1630 additions and 266 deletions

View File

@@ -15,7 +15,8 @@ public interface InteractionService {
CompletableFuture<InteractionHook> replyString(String text, IReplyCallback callback);
CompletableFuture<InteractionHook> replyEmbed(String templateKey, IReplyCallback callback);
List<CompletableFuture<Message>> sendEmbed(String templateKey, InteractionHook interactionHook);
CompletableFuture<Message> editOriginal(MessageToSend messageToSend, InteractionHook interactionHook);
CompletableFuture<Message> replaceOriginal(MessageToSend messageToSend, InteractionHook interactionHook);
CompletableFuture<Message> replaceOriginal(String template, Object model, InteractionHook interactionHook);
CompletableFuture<InteractionHook> replyMessageToSend(MessageToSend messageToSend, IReplyCallback callback);
CompletableFuture<InteractionHook> replyMessage(String templateKey, Object model, IReplyCallback callback);
CompletableFuture<Message> replyString(String content, InteractionHook interactionHook);

View File

@@ -1,7 +1,9 @@
package dev.sheldan.abstracto.core.interaction.slash;
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
import net.dv8tion.jda.api.interactions.commands.Command;
import net.dv8tion.jda.api.interactions.commands.build.SlashCommandData;
import org.springframework.data.util.Pair;
@@ -16,4 +18,6 @@ public interface SlashCommandService {
CompletableFuture<Void> deleteGuildSlashCommands(Guild guild, List<Long> slashCommandId, List<Long> commandInServerIdsToUnset);
CompletableFuture<Void> addGuildSlashCommands(Guild guild, List<Pair<List<CommandConfiguration>, SlashCommandData>> commandData);
void storeCreatedSlashCommands(Guild guild, List<Pair<List<CommandConfiguration>, SlashCommandData>> commandData, List<Command> createdCommands);
CompletableFuture<CommandResult> completeConfirmableCommand(SlashCommandInteractionEvent event, String template);
CompletableFuture<CommandResult> completeConfirmableCommand(SlashCommandInteractionEvent event, String template, Object parameter);
}

View File

@@ -3,6 +3,7 @@ package dev.sheldan.abstracto.core.interaction.slash.parameter;
import dev.sheldan.abstracto.core.command.config.Parameter;
import dev.sheldan.abstracto.core.models.database.AEmote;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.emoji.Emoji;
import net.dv8tion.jda.api.interactions.commands.CommandInteractionPayload;
import net.dv8tion.jda.api.interactions.commands.OptionType;
@@ -16,8 +17,8 @@ public interface SlashCommandParameterService {
Object getCommandOption(String name, CommandInteractionPayload event);
Boolean hasCommandOption(String name, CommandInteractionPayload event);
Boolean hasCommandOptionWithFullType(String name, CommandInteractionPayload event, OptionType optionType);
AEmote loadAEmoteFromString(String input, CommandInteractionPayload event);
Emoji loadEmoteFromString(String input, CommandInteractionPayload event);
AEmote loadAEmoteFromString(String input, Guild guild);
Emoji loadEmoteFromString(String input, Guild guild);
List<OptionType> getTypesFromParameter(Parameter parameter);
List<OptionType> getTypesFromParameter(Class clazz);
String getFullQualifiedParameterName(String name, OptionType type);