[AB-xxx] migrating assignable role commands to slash commands

removing separate command for editing assignable role place text, and adding it to the change command
fixing 2 bugs related with deleting assignable roles with users, and deleting assignable role places
refactoring how enums are handled with slash command parameters
adding cleanup for slash command confirmation payloads once they are clicked
This commit is contained in:
Sheldan
2025-02-16 22:30:27 +01:00
parent a8c2dfe15a
commit 8544c0c2b1
48 changed files with 1055 additions and 426 deletions

View File

@@ -116,19 +116,13 @@ public class DeletedEmoteStats extends AbstractConditionableCommand {
.build();
parameters.add(periodParameter);
List<String> emoteTypes = Arrays
.stream(UsedEmoteTypeParameter.values())
.map(Enum::name)
.collect(Collectors.toList());
Parameter typeParameter = Parameter
.builder()
.name(DELETED_EMOTE_STATS_USED_EMOTE_TYPE)
.templated(true)
.slashCommandOnly(true)
.optional(true)
.choices(emoteTypes)
.type(String.class)
.type(UsedEmoteTypeParameter.class)
.build();
parameters.add(typeParameter);

View File

@@ -124,19 +124,13 @@ public class EmoteStat extends AbstractConditionableCommand {
.build();
parameters.add(periodParameter);
List<String> emoteTypes = Arrays
.stream(UsedEmoteTypeParameter.values())
.map(Enum::name)
.collect(Collectors.toList());
Parameter typeParameter = Parameter
.builder()
.name(EMOTE_STAT_USED_EMOTE_TYPE)
.templated(true)
.slashCommandOnly(true)
.optional(true)
.choices(emoteTypes)
.type(String.class)
.type(UsedEmoteTypeParameter.class)
.build();
parameters.add(typeParameter);

View File

@@ -118,19 +118,13 @@ public class EmoteStats extends AbstractConditionableCommand {
parameters.add(periodParameter);
List<String> emoteTypes = Arrays
.stream(UsedEmoteTypeParameter.values())
.map(Enum::name)
.collect(Collectors.toList());
Parameter typeParameter = Parameter
.builder()
.name(EMOTE_STATS_USED_EMOTE_TYPE)
.templated(true)
.slashCommandOnly(true)
.optional(true)
.choices(emoteTypes)
.type(String.class)
.type(UsedEmoteTypeParameter.class)
.build();
SlashCommandConfig slashCommandConfig = SlashCommandConfig

View File

@@ -128,19 +128,13 @@ public class ExternalEmoteStats extends AbstractConditionableCommand {
.templated(true)
.build();
List<String> emoteTypes = Arrays
.stream(UsedEmoteTypeParameter.values())
.map(Enum::name)
.collect(Collectors.toList());
Parameter typeParameter = Parameter
.builder()
.name(EXTERNAL_EMOTE_STATS_USED_EMOTE_TYPE)
.templated(true)
.slashCommandOnly(true)
.optional(true)
.choices(emoteTypes)
.type(String.class)
.type(UsedEmoteTypeParameter.class)
.build();
parameters.add(typeParameter);

View File

@@ -1,8 +1,9 @@
package dev.sheldan.abstracto.statistic.emote.command.parameter;
import dev.sheldan.abstracto.core.command.execution.CommandParameterKey;
import dev.sheldan.abstracto.statistic.emote.model.database.UsedEmoteType;
public enum UsedEmoteTypeParameter {
public enum UsedEmoteTypeParameter implements CommandParameterKey {
REACTION,
MESSAGE;