[AB-xxx] reworking moderation commands to use more defer logic, so that they do not time out anymore

removed message command condition, as it seemed unused
This commit is contained in:
Sheldan
2025-02-23 21:13:27 +01:00
parent 33ad3bdc5d
commit ec78a0d856
14 changed files with 193 additions and 108 deletions

View File

@@ -35,13 +35,10 @@ public abstract class AbstractConditionableCommand implements ConditionalCommand
@Autowired
private CommandCoolDownCondition coolDownCondition;
@Autowired
private MessageCommandCondition messageCommandCondition;
@Override
public List<CommandCondition> getConditions() {
return new ArrayList<>(Arrays.asList(adminModeCondition, featureEnabledCondition, commandDisabledCondition,
commandDisallowedCondition, featureModeCondition, coolDownCondition, messageCommandCondition));
commandDisallowedCondition, featureModeCondition, coolDownCondition));
}
protected void checkParameters(CommandContext context) {

View File

@@ -1,18 +0,0 @@
package dev.sheldan.abstracto.core.command.condition;
import dev.sheldan.abstracto.core.command.Command;
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import org.springframework.stereotype.Component;
@Component
public class MessageCommandCondition implements CommandCondition {
@Override
public ConditionResult shouldExecute(CommandContext commandContext, Command command) {
if(command.getConfiguration().isSupportsMessageCommand()) {
return ConditionResult.builder().result(true).build();
} else {
return ConditionResult.builder().result(false).reportResult(false).build();
}
}
}

View File

@@ -41,9 +41,6 @@ public class CommandConfiguration {
@Builder.Default
private List<EffectConfig> effects = new ArrayList<>();
@Builder.Default
private boolean supportsMessageCommand = true;
@Builder.Default
private boolean slashCommandOnly = false;