mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-14 03:45:57 +00:00
[AB-68] adding invite filter with commands to allow/disallow invites, remove stored filtered invite links and show filtered invite links
removing database entities from command context
This commit is contained in:
@@ -9,6 +9,8 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -21,11 +23,15 @@ public class ActivateAssignableRolePlace extends AbstractConditionableCommand {
|
||||
@Autowired
|
||||
private AssignableRolePlaceService service;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
String name = (String) parameters.get(0);
|
||||
service.activateAssignableRolePlace(commandContext.getUserInitiatedContext().getServer(), name);
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
service.activateAssignableRolePlace(server, name);
|
||||
return CommandResult.fromSuccess();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,9 @@ import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.FullEmote;
|
||||
import dev.sheldan.abstracto.core.models.FullRole;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.RoleService;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -30,6 +32,9 @@ public class AddRoleToAssignableRolePost extends AbstractConditionableCommand {
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
@@ -37,13 +42,14 @@ public class AddRoleToAssignableRolePost extends AbstractConditionableCommand {
|
||||
FullEmote emote = (FullEmote) parameters.get(1);
|
||||
String description = (String) parameters.get(2);
|
||||
FullRole role = (FullRole) parameters.get(3);
|
||||
if(service.hasAssignableRolePlaceEmote(commandContext.getUserInitiatedContext().getServer(), name, emote.getFakeEmote())) {
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
if(service.hasAssignableRolePlaceEmote(server, name, emote.getFakeEmote())) {
|
||||
throw new AssignableRoleAlreadyDefinedException(emote, name);
|
||||
}
|
||||
if(!roleService.canBotInteractWithRole(role.getRole())) {
|
||||
throw new AssignableRoleNotUsableException(role, commandContext.getGuild());
|
||||
}
|
||||
return service.addRoleToAssignableRolePlace(commandContext.getUserInitiatedContext().getServer(), name, role.getRole(), emote, description)
|
||||
return service.addRoleToAssignableRolePlace(server, name, role.getRole(), emote, description)
|
||||
.thenApply(aVoid -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -25,13 +27,18 @@ public class ChangeAssignableRolePlaceConfig extends AbstractConditionableComman
|
||||
@Autowired
|
||||
private AssignableRolePlaceService service;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
String name = (String) parameters.get(0);
|
||||
AssignableRolePlaceParameterKey configKey = (AssignableRolePlaceParameterKey) parameters.get(1);
|
||||
Object parameterValue = parameters.get(2);
|
||||
return service.changeConfiguration(commandContext.getUserInitiatedContext().getServer(), name, configKey, parameterValue)
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
return service.changeConfiguration(server, name, configKey, parameterValue)
|
||||
.thenApply(aVoid -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,9 @@ import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.database.AChannel;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ChannelManagementService;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import net.dv8tion.jda.api.entities.MessageChannel;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -31,6 +33,9 @@ public class CreateAssignableRolePost extends AbstractConditionableCommand {
|
||||
@Autowired
|
||||
private ChannelManagementService channelManagementService;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
@@ -38,7 +43,8 @@ public class CreateAssignableRolePost extends AbstractConditionableCommand {
|
||||
MessageChannel channel = (TextChannel) parameters.get(1);
|
||||
String text = (String) parameters.get(2);
|
||||
AChannel chosenChannel = channelManagementService.loadChannel(channel.getIdLong());
|
||||
service.createAssignableRolePlace(commandContext.getUserInitiatedContext().getServer(), name, chosenChannel, text);
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
service.createAssignableRolePlace(server, name, chosenChannel, text);
|
||||
return CommandResult.fromSuccess();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -21,11 +23,15 @@ public class DeactivateAssignableRolePlace extends AbstractConditionableCommand
|
||||
@Autowired
|
||||
private AssignableRolePlaceService service;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
String name = (String) parameters.get(0);
|
||||
service.deactivateAssignableRolePlace(commandContext.getUserInitiatedContext().getServer(), name);
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
service.deactivateAssignableRolePlace(server, name);
|
||||
return CommandResult.fromSuccess();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -22,11 +24,15 @@ public class DeleteAssignableRolePlace extends AbstractConditionableCommand {
|
||||
@Autowired
|
||||
private AssignableRolePlaceService service;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
String name = (String) parameters.get(0);
|
||||
return service.deleteAssignableRolePlace(commandContext.getUserInitiatedContext().getServer(), name)
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
return service.deleteAssignableRolePlace(server, name)
|
||||
.thenApply(aVoid -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import dev.sheldan.abstracto.core.command.config.validator.MaxStringLengthValida
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -26,14 +28,16 @@ public class EditAssignableRolePlaceText extends AbstractConditionableCommand {
|
||||
@Autowired
|
||||
private AssignableRolePlaceService service;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
String name = (String) parameters.get(0);
|
||||
String newText = (String) parameters.get(1);
|
||||
|
||||
return service.changeText(commandContext.getUserInitiatedContext().getServer(), name, newText)
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
return service.changeText(server, name, newText)
|
||||
.thenApply(aVoid -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,12 +24,16 @@ public class MoveAssignableRolePlace extends AbstractConditionableCommand {
|
||||
@Autowired
|
||||
private AssignableRolePlaceService placeManagementService;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
String name = (String) parameters.get(0);
|
||||
TextChannel newChannel = (TextChannel) parameters.get(1);
|
||||
placeManagementService.moveAssignableRolePlace(commandContext.getUserInitiatedContext().getServer(), name, newChannel);
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
placeManagementService.moveAssignableRolePlace(server, name, newChannel);
|
||||
return CommandResult.fromSuccess();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.FullEmote;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -23,12 +25,16 @@ public class RemoveRoleFromAssignableRolePlace extends AbstractConditionableComm
|
||||
@Autowired
|
||||
private AssignableRolePlaceService service;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
String name = (String) parameters.get(0);
|
||||
FullEmote emote = (FullEmote) parameters.get(1);
|
||||
return service.removeRoleFromAssignableRolePlace(commandContext.getUserInitiatedContext().getServer(), name, emote)
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
return service.removeRoleFromAssignableRolePlace(server, name, emote)
|
||||
.thenApply(aVoid -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.FullEmote;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -22,13 +24,17 @@ public class SetAssignableRolePosition extends AbstractConditionableCommand {
|
||||
@Autowired
|
||||
private AssignableRolePlaceService service;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
String name = (String) parameters.get(0);
|
||||
FullEmote emote = (FullEmote) parameters.get(1);
|
||||
Integer newPosition = (Integer) parameters.get(2);
|
||||
service.setEmoteToPosition(commandContext.getUserInitiatedContext().getServer(), name, emote, newPosition);
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
service.setEmoteToPosition(server, name, emote, newPosition);
|
||||
return CommandResult.fromSuccess();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,9 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.ChannelService;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -28,11 +30,15 @@ public class SetupAssignableRolePlace extends AbstractConditionableCommand {
|
||||
@Autowired
|
||||
private ChannelService channelService;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
String name = (String) parameters.get(0);
|
||||
return service.setupAssignableRolePlace(commandContext.getUserInitiatedContext().getServer(), name)
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
return service.setupAssignableRolePlace(server, name)
|
||||
.thenApply(aVoid -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -22,12 +24,16 @@ public class ShowAssignableRolePlaceConfig extends AbstractConditionableCommand
|
||||
@Autowired
|
||||
private AssignableRolePlaceService service;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
String name = (String) parameters.get(0);
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
// TODO refactor to return something to be posted in this command here instead of relying it to be posted somewhere else
|
||||
service.showAssignablePlaceConfig(commandContext.getUserInitiatedContext().getServer(), name, commandContext.getChannel());
|
||||
service.showAssignablePlaceConfig(server, name, commandContext.getChannel());
|
||||
return CommandResult.fromIgnored();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -20,9 +22,13 @@ public class ShowAssignableRolePlaces extends AbstractConditionableCommand {
|
||||
@Autowired
|
||||
private AssignableRolePlaceService service;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
return service.showAllAssignableRolePlaces(commandContext.getUserInitiatedContext().getServer(), commandContext.getChannel())
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
return service.showAllAssignableRolePlaces(server, commandContext.getChannel())
|
||||
.thenApply(aVoid -> CommandResult.fromIgnored());
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.FullEmote;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.EmoteService;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -28,13 +29,16 @@ public class SwapAssignableRolePosition extends AbstractConditionableCommand {
|
||||
@Autowired
|
||||
private EmoteService emoteService;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
String name = (String) parameters.get(0);
|
||||
FullEmote firstEmote = (FullEmote) parameters.get(1);
|
||||
FullEmote secondEmote = (FullEmote) parameters.get(2);
|
||||
AServer server = commandContext.getUserInitiatedContext().getServer();
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
if(emoteService.compareAEmote(firstEmote.getFakeEmote(), secondEmote.getFakeEmote())) {
|
||||
return CommandResult.fromError("You cannot swap the same emote");
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -22,11 +24,15 @@ public class TestAssignableRolePlace extends AbstractConditionableCommand {
|
||||
@Autowired
|
||||
private AssignableRolePlaceService service;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
String name = (String) parameters.get(0);
|
||||
return service.testAssignableRolePlace(commandContext.getUserInitiatedContext().getServer(), name, commandContext.getChannel())
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
return service.testAssignableRolePlace(server, name, commandContext.getChannel())
|
||||
.thenApply(aVoid -> CommandResult.fromIgnored());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user