[OPB-12] adding news/newsupdate command and introducing mechanisms for cleanup thereof

changing templates to have the metaconfig
moving starboard custom templates
This commit is contained in:
Sheldan
2021-04-24 01:38:59 +02:00
parent d860ad6291
commit bf55064984
64 changed files with 2477 additions and 10 deletions

View File

@@ -0,0 +1,39 @@
<?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.modules</groupId>
<artifactId>oneplus-bot-modules-templates</artifactId>
<version>1.3.9-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>news-templates</artifactId>
<packaging>pom</packaging>
<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>starboard-custom-templates-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,12 @@
{
<#assign roleMention="<@&823285857515470868>"/>
<#assign authorMention>${author.user.name}#${author.user.discriminator}</#assign>
"additionalMessage": "<@safe_include "news_post_description"/>",
<#if message.attachments?size gt 0>
"imageUrl": "${message.attachments[0].proxyUrl}",
</#if>
"metaConfig": {
"allowsRoleMention": true,
"preventEmptyEmbed": true
}
}

View File

@@ -0,0 +1 @@
<#include "news_post_locked_exception_message">

View File

@@ -0,0 +1 @@
<#include "news_post_not_found_exception_text">

View File

@@ -8,11 +8,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
<artifactId>oneplus-bot-modules</artifactId>
<artifactId>oneplus-bot-modules-templates</artifactId>
<packaging>pom</packaging>
<version>1.3.9-SNAPSHOT</version>
<modules>
<module>starboard-custom</module>
<module>news-templates</module>
</modules>

View File

@@ -2,7 +2,7 @@
<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.modules</groupId>
<artifactId>oneplus-bot-modules</artifactId>
<artifactId>oneplus-bot-modules-templates</artifactId>
<version>1.3.9-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -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>

View File

@@ -13,5 +13,7 @@
}
],
"additionalMessage": "${definition.definition?json_string}",
"messageLimit": 1
"metaConfig": {
"messageLimit": 1
}
}

View File

@@ -8,7 +8,7 @@
</parent>
<modules>
<module>oneplus-bot-modules</module>
<module>oneplus-bot-modules-templates</module>
<module>translations</module>
<module>overrides</module>
</modules>

View 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.translations</groupId>
<artifactId>translations</artifactId>
<version>1.3.9-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>news-translations</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>starboard-custom-templates-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -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>

View File

@@ -0,0 +1 @@
Posts a news post in the news channel

View File

@@ -0,0 +1,4 @@
Creates a news with the provided text and any attachments in the `news` post target with the defined template.
The news post can be updated via editing the original message containing the command or by the command `updateNews`.
This is only possible as long as the news post has not been locked. This is the case a few hours after posting it.
The news posts are completely removed from the database a few days after locking them.

View File

@@ -0,0 +1 @@
The text the news post should contain

View File

@@ -0,0 +1,4 @@
${messageText}
${roleMention?json_string}
- ${authorMention}

View File

@@ -0,0 +1 @@
Command used to update an existing news post content

View File

@@ -0,0 +1,4 @@
This command can be used to update the news post complete.
This will effectively render the template new (including author) and replace the contents of the existing news post.
Editing the news post does not re-ping any roles.
This is only possible as long as the news post was not locked and is still stored in the database.

View File

@@ -0,0 +1 @@
The ID of the news post message which was created.

View File

@@ -0,0 +1 @@
The new text the news post should receive.

View File

@@ -0,0 +1 @@
The channel in which the news should be posted in. Currently: ${currentTarget}

View File

@@ -0,0 +1 @@
Module used to post & update news in the server

View File

@@ -0,0 +1 @@
News post is locked and cannot be edited.

View File

@@ -12,5 +12,6 @@
<packaging>pom</packaging>
<modules>
<module>starboard-custom-translations</module>
<module>news-translations</module>
</modules>
</project>