removed decay feature boolean from myWarnings, because only automatic decay is an additional feature

fixed post target for kicking
fixed casing for mod mail post targets
added initial version of the ascii doctor documentation
This commit is contained in:
Sheldan
2020-05-11 15:00:00 +02:00
parent ba032194ce
commit 9197fe0268
17 changed files with 556 additions and 13 deletions

View File

@@ -43,8 +43,6 @@ public class MyWarnings extends AbstractConditionableCommand {
Long currentWarnCount = warnManagementService.getActiveWarnsForUser(commandContext.getUserInitiatedContext().getAUserInAServer());
model.setCurrentWarnCount(currentWarnCount);
Long totalWarnCount = warnManagementService.getTotalWarnsForUser(commandContext.getUserInitiatedContext().getAUserInAServer());
boolean userUsesDecay = featureFlagService.isFeatureEnabled(warningDecayFeature, commandContext.getUserInitiatedContext().getServer());
model.setServerUsesDecays(userUsesDecay);
model.setTotalWarnCount(totalWarnCount);
channelService.sendTemplateInChannel("myWarnings_response", model, commandContext.getChannel());
return CommandResult.fromSuccess();

View File

@@ -18,7 +18,7 @@ import java.util.Optional;
public class KickServiceBean implements KickService {
private static final String KICK_LOG_TEMPLATE = "kick_log";
private static final String WARN_LOG_TARGET = "warnLog";
private static final String KICK_LOG_TARGET = "kickLog";
@Autowired
private BotService botService;
@@ -43,6 +43,6 @@ public class KickServiceBean implements KickService {
private void sendKickLog(KickLogModel kickLogModel) {
String warnLogMessage = templateService.renderTemplate(KICK_LOG_TEMPLATE, kickLogModel);
postTargetService.sendTextInPostTarget(warnLogMessage, WARN_LOG_TARGET, kickLogModel.getServer().getId());
postTargetService.sendTextInPostTarget(warnLogMessage, KICK_LOG_TARGET, kickLogModel.getServer().getId());
}
}

View File

@@ -9,9 +9,6 @@
"b": 255
}
<#assign userMention>${member.effectiveName}</#assign>
<#if serverUsesDecays>
,"description" :"<#include "myWarnings_with_decay_embed_description">"
<#else>
,"description" :"<#include "myWarnings_embed_description">"
</#if>
}

View File

@@ -9,7 +9,6 @@ import lombok.experimental.SuperBuilder;
@Setter
@SuperBuilder
public class MyWarningsModel extends UserInitiatedServerContext {
private Boolean serverUsesDecays;
private Long totalWarnCount;
private Long currentWarnCount;
}