[RAB-2] adding code to retrieve legacy quotes

adding migration script for legacy quotes
changing docker-compose file to use different container names
This commit is contained in:
Sheldan
2022-05-15 16:13:48 +02:00
parent da6c4a5b23
commit 199ca18cac
80 changed files with 3038 additions and 28 deletions

View File

@@ -7,7 +7,13 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>dev.sheldan.raustria.bot.templates</groupId>
<artifactId>templates</artifactId>
<packaging>pom</packaging>
<modules>
<module>r-austria-bot-templates</module>
<module>r-austria-bot-translations</module>
</modules>
</project>

View File

@@ -0,0 +1,18 @@
<?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.raustria.bot.templates</groupId>
<artifactId>r-austria-bot-templates</artifactId>
<version>1.0.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>module-templates</artifactId>
<packaging>pom</packaging>
<modules>
<module>quotes-templates</module>
</modules>
</project>

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.raustria.bot.templates</groupId>
<artifactId>module-templates</artifactId>
<version>1.0.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quotes-templates</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>quotes-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,26 @@
{
"embeds": [
{
<#include "abstracto_color">,
"author": {
<#assign authorName><@default_template_if_null authorName "quote_response_default_author_name"/></#assign>
<#assign channelName><@default_template_if_null sourceChannelName "quote_response_default_channel_name"/></#assign>
"name": "<@safe_include "quote_response_header_author_name"/>"
<#if authorAvatarURL??>,"avatar": "${authorAvatarURL}"</#if>
},
<#assign quoteId=quoteId>
<#assign quoteDescription=quoteContent>
<#assign quoteJumpUrl=quotedMessage.jumpUrl>
"description": "<@safe_include "quote_response_description"/>",
"footer": {
<#assign adderUserName><@default_template_if_null adderName "quote_response_default_adder_name"/></#assign>
"text": "<@safe_include "quote_response_footer_adder_name" />"
<#if adderAvatarURL??>,"icon": "${adderAvatarURL}"</#if>
},
<#if imageAttachmentURLs?size = 1>
"imageUrl": "${imageAttachmentURLs[0]}",
</#if>
"timeStamp": "${creationDate}"
}
]
}

View File

@@ -0,0 +1,6 @@
{
<#assign userName=userName>
<#assign adderCount=quoteCount>
<#assign quotedCount=authorCount>
"additionalMessage": "<@safe_include "quoteStats_response_message_text"/>"
}

View File

@@ -0,0 +1,18 @@
<?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>
<artifactId>templates</artifactId>
<groupId>dev.sheldan.raustria.bot.templates</groupId>
<version>1.0.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>r-austria-bot-templates</artifactId>
<packaging>pom</packaging>
<modules>
<module>module-templates</module>
</modules>
</project>

View File

@@ -0,0 +1,19 @@
<?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.raustria.bot.templates.translations</groupId>
<artifactId>r-austria-bot-translations</artifactId>
<version>1.0.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>module-translations</artifactId>
<packaging>pom</packaging>
<modules>
<module>quote-translations</module>
</modules>
</project>

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>
<artifactId>module-translations</artifactId>
<groupId>dev.sheldan.raustria.bot.templates.translations</groupId>
<version>1.0.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quote-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>quotes-translations-${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,2 @@
Shows a random quote from the server or from the given member.
Will display an error if there is no quote found.

View File

@@ -0,0 +1,2 @@
[**Quote #${quoteId?c}**](${quoteJumpUrl})
${quoteDescription}

View File

@@ -0,0 +1 @@
Deletes a quote completely from the database. Will ask for confirmation before doing so.

View File

@@ -0,0 +1 @@
This command can be used to retrieve and show a single quote by the ID

View File

@@ -0,0 +1,3 @@
This command can be used to search through all quotes by a text query.
It will return quotes in which the text of the quote contains the given query.
If there are more quotes found, the first one is returned.

View File

@@ -0,0 +1 @@
The text which should be searched for. A query whose text contains this will match.

View File

@@ -0,0 +1 @@
Can be used to see how often you or any other member has been quoted or how many quotes were added.

View File

@@ -0,0 +1 @@
:pencil: ${userName} been quoted ${quotedCount} times, and has added ${adderCount} quotes.

View File

@@ -0,0 +1,20 @@
<?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>
<artifactId>templates</artifactId>
<groupId>dev.sheldan.raustria.bot.templates</groupId>
<version>1.0.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>dev.sheldan.raustria.bot.templates.translations</groupId>
<artifactId>r-austria-bot-translations</artifactId>
<packaging>pom</packaging>
<modules>
<module>module-translations</module>
</modules>
</project>