renamed feature display to feature config

added concept of feature dependencies, if one feature depends on another feature, and it gets enabled, the other feature is enabled as well
changed some feature related apis
added ability to automatically decay warnings (separate feature)
added command to trigger the warn decay manually
added command to decay all active warnings
added method to scheduler service to directly start a cron job
This commit is contained in:
Sheldan
2020-04-29 21:25:26 +02:00
parent 85c47db5ed
commit d5482fabd4
60 changed files with 571 additions and 97 deletions

View File

@@ -1,12 +1,21 @@
abstracto.postTargets.moderation=joinLog,leaveLog,warnLog,kickLog,banLog,editLog,deleteLog,muteLog
abstracto.postTargets.moderation=joinLog,leaveLog,warnLog,kickLog,banLog,editLog,deleteLog,muteLog,decayLog
abstracto.features.moderation=false
abstracto.features.warning=false
abstracto.features.logging=true
abstracto.features.mutes=true
abstracto.warnings.warnDecay.days=90
abstracto.scheduling.jobs.unMuteJob.name=unMuteJob
abstracto.scheduling.jobs.unMuteJob.group=moderation
abstracto.scheduling.jobs.unMuteJob.clazz=dev.sheldan.abstracto.moderation.job.UnMuteJob
abstracto.scheduling.jobs.unMuteJob.standAlone=false
abstracto.scheduling.jobs.unMuteJob.active=true
abstracto.scheduling.jobs.unMuteJob.recovery=false
abstracto.scheduling.jobs.unMuteJob.recovery=false
abstracto.scheduling.jobs.warnDecayJob.name=warnDecayJob
abstracto.scheduling.jobs.warnDecayJob.group=moderation
abstracto.scheduling.jobs.warnDecayJob.clazz=dev.sheldan.abstracto.moderation.job.WarnDecayJob
abstracto.scheduling.jobs.warnDecayJob.standAlone=true
abstracto.scheduling.jobs.warnDecayJob.active=true
abstracto.scheduling.jobs.warnDecayJob.cronExpression=0 0 * * * ?
abstracto.scheduling.jobs.warnDecayJob.recovery=false

View File

@@ -0,0 +1 @@
Decays all warnings which are currently active on this server, and logs them to the `decayLog` post target, if the parameter was true.

View File

@@ -0,0 +1 @@
Causes the warnings older than the configured threshold in days to be decayed. They are still stored but there is an indication, that they are now longer active.

View File

@@ -0,0 +1,17 @@
{
"title": {
"title": "Warnings have been decayed"
},
"color" : {
"r": 200,
"g": 0,
"b": 255
},
"description": "<#list warnings as warning>
<#if warning.warnedMember??>${warning.warnedMember.asMention} (${warning.warnedMember.id})<#else>${warning.warning.warnedUser.userReference.id?c}</#if> was warned on ${formatInstant(warning.warning.warnDate, "yyyy-MM-dd HH:mm:ss")}
with reason `${warning.warning.reason}` by <#if warning.warningMember??>${warning.warningMember.asMention} (${warning.warningMember.id})<#else>${warning.warning.warningUser.userReference.id?c}</#if>
<#else>
No warnings to decay.
</#list>"
}