[AB-xxx] changing the structure of starboard post model

This commit is contained in:
Sheldan
2025-11-22 15:28:00 +01:00
parent d293d764db
commit c791c063e3
8 changed files with 47 additions and 18 deletions

View File

@@ -426,7 +426,7 @@ public class CommandReceivedHandler extends ListenerAdapter {
Parameter param = parameters.get(0);
CommandParameterIterators iterators = new CommandParameterIterators(channelIterator, emoteIterator, memberIterator, roleIterator);
Set<CommandParameterHandler> usedParameterHandler = findNecessaryCommandParameterHandlers(parameters, unParsedCommandParameter);
List<CompletableFuture> futures = new ArrayList<>();
List<CompletableFuture<?>> futures = new ArrayList<>();
// the actual parameters which were handled, might not coincide with the unparsed parameters
// because we might ignore some parameters (for example referenced messages) in case the command does not use this as a parameter
int parsedParameter = 0;
@@ -443,7 +443,7 @@ public class CommandReceivedHandler extends ListenerAdapter {
.getDependentFeatures()
.stream()
.map(s -> featureConfigService.getFeatureEnum(s))
.collect(Collectors.toList());
.toList();
boolean parameterActiveForFeatures = false;
for (FeatureDefinition featureDefinition : featureDefinitions) {
if(featureFlagService.getFeatureFlagValue(featureDefinition, message.getGuild().getIdLong())) {
@@ -460,7 +460,7 @@ public class CommandReceivedHandler extends ListenerAdapter {
try {
if (handler.handles(param.getType(), value)) {
if (handler.async()) {
CompletableFuture future = handler.handleAsync(value, iterators, param, message, command);
CompletableFuture<?> future = handler.handleAsync(value, iterators, param, message, command);
futures.add(future);
parsedParameters.add(ParseResult.builder().parameter(param).result(future).build());
} else {
@@ -488,11 +488,11 @@ public class CommandReceivedHandler extends ListenerAdapter {
combinedFuture.thenAccept(aVoid -> {
List<Object> allParamResults = parsedParameters.stream().map(o -> {
if (o.getResult() instanceof CompletableFuture) {
return ((CompletableFuture) o.getResult()).join();
return ((CompletableFuture<?>) o.getResult()).join();
} else {
return o.getResult();
}
}).collect(Collectors.toList());
}).toList();
List<ParseResult> parseResults = new ArrayList<>();
for (int i = 0; i < allParamResults.size(); i++) {
if (allParamResults.get(i) != null) {

View File

@@ -232,7 +232,7 @@ public class CacheEntityServiceBean implements CacheEntityService {
List<CompletableFuture<CachedReactions>> reactionFutures = new ArrayList<>();
log.debug("Caching {} reactions.", message.getReactions().size());
message.getReactions().forEach(messageReaction -> reactionFutures.add(getCachedReactionFromReaction(messageReaction)));
List<CompletableFuture> allFutures = new ArrayList<>(reactionFutures);
List<CompletableFuture<?>> allFutures = new ArrayList<>(reactionFutures);
allFutures.add(referencedMessageFuture);
FutureUtils.toSingleFuture(allFutures).thenAccept(aVoid ->
{