mirror of
https://github.com/Sheldan/OnePlusBot.git
synced 2026-01-01 15:28:28 +00:00
[OPB-13] adding logging module and customizing leave message templates
This commit is contained in:
@@ -95,6 +95,11 @@
|
||||
<artifactId>starboard-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>logging-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.custom</groupId>
|
||||
<artifactId>starboard-custom</artifactId>
|
||||
|
||||
@@ -2,8 +2,8 @@ package dev.sheldan.oneplus.bot.modules.news.listener;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.listener.DefaultListenerResult;
|
||||
import dev.sheldan.abstracto.core.listener.async.jda.AsyncMessageTextUpdatedListener;
|
||||
import dev.sheldan.abstracto.core.models.listener.MessageTextUpdatedModel;
|
||||
import dev.sheldan.abstracto.core.listener.async.jda.AsyncMessageUpdatedListener;
|
||||
import dev.sheldan.abstracto.core.models.listener.MessageUpdatedModel;
|
||||
import dev.sheldan.oneplus.bot.modules.news.config.NewsFeatureDefinition;
|
||||
import dev.sheldan.oneplus.bot.modules.news.model.database.NewsPost;
|
||||
import dev.sheldan.oneplus.bot.modules.news.service.NewsServiceBean;
|
||||
@@ -16,7 +16,7 @@ import java.util.Optional;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class NewsMessageSourceMessageUpdatedListener implements AsyncMessageTextUpdatedListener {
|
||||
public class NewsMessageSourceMessageUpdatedListener implements AsyncMessageUpdatedListener {
|
||||
|
||||
@Autowired
|
||||
private NewsPostManagementServiceBean newsPostManagementServiceBean;
|
||||
@@ -25,7 +25,7 @@ public class NewsMessageSourceMessageUpdatedListener implements AsyncMessageText
|
||||
private NewsServiceBean newsServiceBean;
|
||||
|
||||
@Override
|
||||
public DefaultListenerResult execute(MessageTextUpdatedModel model) {
|
||||
public DefaultListenerResult execute(MessageUpdatedModel model) {
|
||||
Optional<NewsPost> existingPostOptional = newsPostManagementServiceBean.getNewsPostForSourceMessage(model.getAfter().getIdLong());
|
||||
if(existingPostOptional.isPresent()) {
|
||||
NewsPost newsPost = existingPostOptional.get();
|
||||
|
||||
@@ -109,6 +109,16 @@
|
||||
<destFileName>remind.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.templates</groupId>
|
||||
<artifactId>logging</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<destFileName>logging.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
|
||||
<artifactId>starboard-custom-templates</artifactId>
|
||||
@@ -206,6 +216,16 @@
|
||||
<destFileName>remind.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>logging</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<destFileName>logging.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.translations</groupId>
|
||||
<artifactId>starboard-custom</artifactId>
|
||||
@@ -328,6 +348,17 @@
|
||||
<destFileName>remind.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>logging-impl</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>logging.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<!-- customizations -->
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.custom</groupId>
|
||||
@@ -373,6 +404,16 @@
|
||||
<destFileName>overrides-templates-webservices.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.overrides.templates</groupId>
|
||||
<artifactId>logging</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<destFileName>overrides-templates-logging.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"template_artifacts": ["utility", "core", "entertainment", "starboard", "link-embed", "webservices", "remind",
|
||||
"starboard-custom", "overrides-templates-webservices", "overrides-templates-core", "news"],
|
||||
"template_artifacts": ["utility", "core", "entertainment", "starboard", "link-embed", "webservices", "remind", "logging",
|
||||
"starboard-custom", "overrides-templates-webservices", "overrides-templates-core", "overrides-templates-logging", "news"],
|
||||
"translation_artifacts": ["utility", "core", "entertainment", "starboard", "link-embed", "webservices",
|
||||
"remind", "starboard-custom", "news"],
|
||||
"remind", "logging", "starboard-custom", "news"],
|
||||
"liquibase_artifacts": [
|
||||
{ "zip": "scheduling", "file": "scheduling-changeLog.xml" },
|
||||
{ "zip": "core", "file": "core-changeLog.xml" },
|
||||
@@ -12,6 +12,7 @@
|
||||
{ "zip": "webservices", "file": "webservices-changeLog.xml"},
|
||||
{ "zip": "starboard", "file": "starboard-changeLog.xml"},
|
||||
{ "zip": "remind", "file": "remind-changeLog.xml"},
|
||||
{ "zip": "logging", "file": "logging-changeLog.xml"},
|
||||
{ "zip": "starboard-custom", "file": "starboard-custom-changeLog.xml"},
|
||||
{ "zip": "news", "file": "news-changeLog.xml"}
|
||||
]
|
||||
|
||||
38
templates/overrides/template-overrides/logging/pom.xml
Normal file
38
templates/overrides/template-overrides/logging/pom.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.overrides.templates</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.3.9-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>logging</artifactId>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<finalName>template-overrides-logging-${project.version}</finalName>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,15 @@
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
|
||||
<id>zip</id>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<outputDirectory>.</outputDirectory>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
<#assign user>${member.user.name}#${member.user.discriminator} (${member.asMention}: ${member.id})</#assign>
|
||||
"additionalMessage": "<@safe_include "user_joined_text"/>"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
<#assign user>${user.name}#${user.discriminator} (${user.id})</#assign>
|
||||
"additionalMessage": "<@safe_include "user_left_text"/>"
|
||||
}
|
||||
@@ -15,8 +15,7 @@
|
||||
<modules>
|
||||
<module>webservices</module>
|
||||
<module>core</module>
|
||||
<module>logging</module>
|
||||
</modules>
|
||||
|
||||
|
||||
|
||||
</project>
|
||||
Reference in New Issue
Block a user