mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-01-22 17:45:48 +00:00
added the concept of commands in server, to have a separate config for commands within a server
added server config listener, to create such commands moved the command and feature creation to separate spring listener (they are dependant, a mechanism for dependencies is needed) added a feature flag to the command table, so we know what the feature of a command is added ability to restrict commands to certain roles/remove the restriction added ability to make some roles not affected by a command/remove the immunity, this works by retrieving the first member from the command parameters, and checking if the member has the said role commands in a server now have a restricted flag to indicate, if the role checks should be in effect (only affects role-to-execute restriction) fixed initial prefix config added the immune user check only to commands most likely needing it
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package dev.sheldan.abstracto.moderation.commands;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.condition.CommandCondition;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -64,4 +65,11 @@ public class Ban extends AbstractConditionableCommand {
|
||||
public FeatureEnum getFeature() {
|
||||
return ModerationFeatures.MODERATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommandCondition> getConditions() {
|
||||
List<CommandCondition> conditions = super.getConditions();
|
||||
conditions.add(immuneUserCondition);
|
||||
return conditions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dev.sheldan.abstracto.moderation.commands;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.condition.CommandCondition;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -63,4 +64,11 @@ public class Kick extends AbstractConditionableCommand {
|
||||
public FeatureEnum getFeature() {
|
||||
return ModerationFeatures.MODERATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommandCondition> getConditions() {
|
||||
List<CommandCondition> conditions = super.getConditions();
|
||||
conditions.add(immuneUserCondition);
|
||||
return conditions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dev.sheldan.abstracto.moderation.commands;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.condition.CommandCondition;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -64,4 +65,11 @@ public class Warn extends AbstractConditionableCommand {
|
||||
public FeatureEnum getFeature() {
|
||||
return ModerationFeatures.WARNING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommandCondition> getConditions() {
|
||||
List<CommandCondition> conditions = super.getConditions();
|
||||
conditions.add(immuneUserCondition);
|
||||
return conditions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dev.sheldan.abstracto.moderation.commands.mute;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.condition.CommandCondition;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -62,4 +63,11 @@ public class Mute extends AbstractConditionableCommand {
|
||||
public FeatureEnum getFeature() {
|
||||
return ModerationFeatures.MUTING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommandCondition> getConditions() {
|
||||
List<CommandCondition> conditions = super.getConditions();
|
||||
conditions.add(immuneUserCondition);
|
||||
return conditions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class StarboardPostReaction {
|
||||
@JoinColumn(name = "reactorId", nullable = false)
|
||||
private AUser reactor;
|
||||
|
||||
@ManyToOne
|
||||
@OneToOne
|
||||
@JoinColumn(name = "postId", nullable = false)
|
||||
private StarboardPost starboardPost;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user