mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-15 12:10:21 +00:00
[AB-150] creating repost detection feature including configuration and documentation
adding http and hash service adding ability to add default emotes to a message to message service adding message embedded listener to wrap the embedded event adding custom channel groups which can be defined by modules, in case a change on a channel group (only created and updated) happens a listener is available in order to sync the state in dependant areas changing command receiver re-throwing abstracto runtime exceptions in order to display them better changing channel group parameter handler to throw an exception in case the channel group was not found adding User in a server parameter handler split channel not found exception to be able to differentiate between not found in database and not found in guild changing exception handling in command received handler to handle the case for only one parameter handler future which failed (the whole single future failed, which was not reported) changing parameter type of `removeFromChannelGroup` to AChannel in order to be able to delete channels in the database via ID moving method to mock utils for mocking consumer removing parameter validation from commands, as it should be done in the command received handler and parameter handlers anyway
This commit is contained in:
@@ -31,7 +31,6 @@ public class DisableExpForRole extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
checkParameters(commandContext);
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
ARole role = (ARole) parameters.get(0);
|
||||
ARole actualRole = roleManagementService.findRole(role.getId());
|
||||
|
||||
@@ -32,7 +32,6 @@ public class DisableExpGain extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
checkParameters(commandContext);
|
||||
Member para = (Member) commandContext.getParameters().getParameters().get(0);
|
||||
AUserInAServer userInAServer = userInServerManagementService.loadUser(para);
|
||||
aUserExperienceService.disableExperienceForUser(userInAServer);
|
||||
|
||||
@@ -31,7 +31,6 @@ public class EnableExpForRole extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
checkParameters(commandContext);
|
||||
ARole role = (ARole) commandContext.getParameters().getParameters().get(0);
|
||||
ARole actualRole = roleManagementService.findRole(role.getId());
|
||||
if(disabledExpRoleManagementService.isExperienceDisabledForRole(actualRole)) {
|
||||
|
||||
@@ -32,7 +32,6 @@ public class EnableExpGain extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
checkParameters(commandContext);
|
||||
Member para = (Member) commandContext.getParameters().getParameters().get(0);
|
||||
AUserInAServer userInAServer = userInServerManagementService.loadUser(para);
|
||||
aUserExperienceService.enableExperienceForUser(userInAServer);
|
||||
|
||||
@@ -30,7 +30,6 @@ public class ExpScale extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
checkParameters(commandContext);
|
||||
Double scale = (Double) commandContext.getParameters().getParameters().get(0);
|
||||
Long guildId = commandContext.getGuild().getIdLong();
|
||||
configService.setDoubleValue(EXP_MULTIPLIER_KEY, guildId, scale);
|
||||
|
||||
@@ -54,7 +54,6 @@ public class LeaderBoardCommand extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
checkParameters(commandContext);
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
// parameter is optional, in case its not present, we default to the 0th page
|
||||
Integer page = !parameters.isEmpty() ? (Integer) parameters.get(0) : 1;
|
||||
|
||||
@@ -42,7 +42,6 @@ public class ListDisabledExperienceRoles extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
checkParameters(commandContext);
|
||||
List<ADisabledExpRole> disabledRolesForServer = disabledExpRoleManagementService.getDisabledRolesForServer(commandContext.getUserInitiatedContext().getServer());
|
||||
DisabledExperienceRolesModel disabledExperienceRolesModel = (DisabledExperienceRolesModel) ContextConverter.fromCommandContext(commandContext, DisabledExperienceRolesModel.class);
|
||||
disabledRolesForServer.forEach(aDisabledExpRole -> {
|
||||
|
||||
@@ -66,7 +66,6 @@ public class Rank extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
checkParameters(commandContext);
|
||||
RankModel rankModel = (RankModel) ContextConverter.slimFromCommandContext(commandContext, RankModel.class);
|
||||
LeaderBoardEntry userRank = userExperienceService.getRankOfUserInServer(commandContext.getUserInitiatedContext().getAUserInAServer());
|
||||
CompletableFuture<LeaderBoardEntryModel> future = converter.fromLeaderBoardEntry(userRank);
|
||||
|
||||
@@ -41,7 +41,6 @@ public class SetExpRole extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
checkParameters(commandContext);
|
||||
Integer level = (Integer) commandContext.getParameters().getParameters().get(0);
|
||||
Role role = (Role) commandContext.getParameters().getParameters().get(1);
|
||||
log.info("Setting role {} to be used for level {} on server {}", role.getId(), level, role.getGuild().getId());
|
||||
|
||||
@@ -33,7 +33,6 @@ public class UnSetExpRole extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
checkParameters(commandContext);
|
||||
ARole role = (ARole) commandContext.getParameters().getParameters().get(0);
|
||||
ARole actualRole = roleManagementService.findRole(role.getId());
|
||||
// do not check for the existence of the role, because if the role was deleted, users should be able
|
||||
|
||||
Reference in New Issue
Block a user