mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-16 04:21:49 +00:00
[AB-106] renaming deletion days to deletion duration
This commit is contained in:
@@ -78,7 +78,7 @@ public class BanReasonUpdatedListener implements InfractionUpdatedDescriptionLis
|
|||||||
Duration deletionDuration = infraction
|
Duration deletionDuration = infraction
|
||||||
.getParameters()
|
.getParameters()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(infractionParameter -> infractionParameter.getInfractionParameterId().getName().equals(BanService.INFRACTION_PARAMETER_DELETION_DAYS_KEY))
|
.filter(infractionParameter -> infractionParameter.getInfractionParameterId().getName().equals(BanService.INFRACTION_PARAMETER_DELETION_DURATION_KEY))
|
||||||
.findAny()
|
.findAny()
|
||||||
.map(InfractionParameter::getValue)
|
.map(InfractionParameter::getValue)
|
||||||
.map(Duration::parse)
|
.map(Duration::parse)
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class BanServiceBean implements BanService {
|
|||||||
AUserInAServer bannedUser = userInServerManagementService.loadOrCreateUser(guild.getIdLong(), user.getIdLong());
|
AUserInAServer bannedUser = userInServerManagementService.loadOrCreateUser(guild.getIdLong(), user.getIdLong());
|
||||||
AUserInAServer banningUser = userInServerManagementService.loadOrCreateUser(banningMember);
|
AUserInAServer banningUser = userInServerManagementService.loadOrCreateUser(banningMember);
|
||||||
Map<String, String> parameters = new HashMap<>();
|
Map<String, String> parameters = new HashMap<>();
|
||||||
parameters.put(INFRACTION_PARAMETER_DELETION_DAYS_KEY, deletionDuration.toString());
|
parameters.put(INFRACTION_PARAMETER_DELETION_DURATION_KEY, deletionDuration.toString());
|
||||||
return infractionService.createInfractionWithNotification(bannedUser, infractionPoints, BAN_INFRACTION_TYPE, reason, banningUser, parameters, banLogMessage)
|
return infractionService.createInfractionWithNotification(bannedUser, infractionPoints, BAN_INFRACTION_TYPE, reason, banningUser, parameters, banLogMessage)
|
||||||
.thenApply(Infraction::getId);
|
.thenApply(Infraction::getId);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
public interface BanService {
|
public interface BanService {
|
||||||
String BAN_EFFECT_KEY = "ban";
|
String BAN_EFFECT_KEY = "ban";
|
||||||
String BAN_INFRACTION_TYPE = "ban";
|
String BAN_INFRACTION_TYPE = "ban";
|
||||||
String INFRACTION_PARAMETER_DELETION_DAYS_KEY = "DELETION_DAYS";
|
String INFRACTION_PARAMETER_DELETION_DURATION_KEY = "DELETION_DURATION";
|
||||||
CompletableFuture<BanResult> banUserWithNotification(User user, String reason, Member banningMember, Duration deletionDuration);
|
CompletableFuture<BanResult> banUserWithNotification(User user, String reason, Member banningMember, Duration deletionDuration);
|
||||||
CompletableFuture<Void> unBanUserWithNotification(User user, Member unBanningUser);
|
CompletableFuture<Void> unBanUserWithNotification(User user, Member unBanningUser);
|
||||||
CompletableFuture<Void> banUser(Guild guild, User user, Duration deletionDuration, String reason);
|
CompletableFuture<Void> banUser(Guild guild, User user, Duration deletionDuration, String reason);
|
||||||
|
|||||||
Reference in New Issue
Block a user