mirror of
https://github.com/Sheldan/OnePlusBot.git
synced 2026-01-01 15:28:28 +00:00
[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:
@@ -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>
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<#include "news_post_locked_exception_message">
|
||||
@@ -0,0 +1 @@
|
||||
<#include "news_post_not_found_exception_text">
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -13,5 +13,7 @@
|
||||
}
|
||||
],
|
||||
"additionalMessage": "${definition.definition?json_string}",
|
||||
"messageLimit": 1
|
||||
"metaConfig": {
|
||||
"messageLimit": 1
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
<module>oneplus-bot-modules</module>
|
||||
<module>oneplus-bot-modules-templates</module>
|
||||
<module>translations</module>
|
||||
<module>overrides</module>
|
||||
</modules>
|
||||
|
||||
38
templates/translations/news-translations/pom.xml
Normal file
38
templates/translations/news-translations/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.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>
|
||||
@@ -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 @@
|
||||
Posts a news post in the news channel
|
||||
@@ -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.
|
||||
@@ -0,0 +1 @@
|
||||
The text the news post should contain
|
||||
@@ -0,0 +1,4 @@
|
||||
${messageText}
|
||||
|
||||
${roleMention?json_string}
|
||||
- ${authorMention}
|
||||
@@ -0,0 +1 @@
|
||||
Command used to update an existing news post content
|
||||
@@ -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.
|
||||
@@ -0,0 +1 @@
|
||||
The ID of the news post message which was created.
|
||||
@@ -0,0 +1 @@
|
||||
The new text the news post should receive.
|
||||
@@ -0,0 +1 @@
|
||||
News
|
||||
@@ -0,0 +1 @@
|
||||
The channel in which the news should be posted in. Currently: ${currentTarget}
|
||||
@@ -0,0 +1 @@
|
||||
Module used to post & update news in the server
|
||||
@@ -0,0 +1 @@
|
||||
News post is locked and cannot be edited.
|
||||
@@ -0,0 +1 @@
|
||||
News post not found.
|
||||
@@ -12,5 +12,6 @@
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>starboard-custom-translations</module>
|
||||
<module>news-translations</module>
|
||||
</modules>
|
||||
</project>
|
||||
Reference in New Issue
Block a user