[AB-80] added statistic module containing a first draft of templates for emote tracking

changed text to indicate a feature mode is part of the default config
removed command reference from incorrect feature mode exception template
This commit is contained in:
Sheldan
2020-11-19 00:33:23 +01:00
parent a711eb99b9
commit 6ec791b24a
94 changed files with 333 additions and 3 deletions
@@ -1,4 +1,3 @@
<#assign commandName=model.command.configuration.name/>
<#assign featureName=model.featureEnum.key/>
<#assign featureModes><#list model.requiredModes as mode>${mode.key}<#sep>,</#list></#assign>
<#include "incorrect_feature_mode_exception_text">
+1
View File
@@ -22,6 +22,7 @@
<module>modmail</module>
<module>utility</module>
<module>assignable-roles</module>
<module>statistic</module>
</modules>
</project>
+39
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.abstracto-templates.templates</groupId>
<artifactId>abstracto-modules</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<artifactId>statistic</artifactId>
<version>1.0-SNAPSHOT</version>
<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>statistic-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,7 @@
{
"title": {
"title": "<@safe_include "deletedEmoteStats_animated_emotes_title"/>"
},
<#include "statistic_color">,
"description": "<#list animatedEmotes as emote>`${emote.trackedEmote.emoteName}:${emote.trackedEmote.trackedEmoteId.emoteId?c}`x${emote.result.amount}<#sep>, </#list>"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "deletedEmoteStats_static_emotes_title"/>"
},
<#include "statistic_color">,
"description": "<#list staticEmotes as emote>`${emote.trackedEmote.emoteName}:${emote.trackedEmote.trackedEmoteId.emoteId?c}`x${emote.result.amount}<#sep>, </#list>"
}
@@ -0,0 +1,3 @@
emoteId,serverId,date,count,animated,external,deleted
<#list emotes as emote>${emote.emoteId.emoteId?c},${emote.emoteId.serverId?c},${formatDate(emote.emoteId.useDate, "yyyy-MM-dd")},${emote.amount},${emote.trackedEmote.animated?string('1', '0')},${emote.trackedEmote.external?string('1', '0')},${emote.trackedEmote.deleted?string('1', '0')}
</#list>
@@ -0,0 +1,6 @@
{
"title": {
"title": "<@safe_include "downloadEmoteStats_no_stats_available_embed_title"/>"
},
<#include "warning_color">
}
@@ -0,0 +1,7 @@
{
<#assign guildName=guild.name>
<#if statsSince?has_content>
<#assign sinceDate>${formatDate(statsSince, "yyyy-MM-dd")}</#assign>
</#if>
"additionalMessage": "<@safe_include "downloadEmoteStats_response_embed_text"/>"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "emoteStats_animated_emotes_title"/>"
},
<#include "statistic_color">,
"description": "<#list animatedEmotes as emote><#if emote.emote?has_content>${emote.emote.asMention}x${emote.result.amount}<#sep> </#if></#list>"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "emoteStats_response_embed_title"/>"
},
<#include "warning_color">,
"description": "<@safe_include "emoteStats_no_stats_available"/>"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "emoteStats_static_emotes_title"/>"
},
<#include "statistic_color">,
"description": "<#list staticEmotes as emote><#if emote.emote?has_content>${emote.emote.asMention}x${emote.result.amount}<#sep> </#if></#list>"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "externalEmoteStats_animated_emotes_title"/>"
},
<#include "statistic_color">,
"description": "<#list animatedEmotes as emote>`${emote.trackedEmote.emoteName}:${emote.trackedEmote.trackedEmoteId.emoteId?c}`x${emote.result.amount}<#sep>, </#list>"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "externalEmoteStats_static_emotes_title"/>"
},
<#include "statistic_color">,
"description": "<#list staticEmotes as emote>`${emote.trackedEmote.emoteName}:${emote.trackedEmote.trackedEmoteId.emoteId?c}`x${emote.result.amount}<#sep>, </#list>"
}
@@ -0,0 +1,21 @@
{
"title": {
"title": "<@safe_include "showExternalTrackedEmote_response_embed_title"/>"
},
<#include "statistic_color">,
"fields": [
{
"name": "<@safe_include "showExternalTrackedEmote_response_embed_emote_name_field_title"/>",
"value": "${emoteName}"
},
{
"name": "<@safe_include "showExternalTrackedEmote_response_embed_emote_id_field_title"/>",
"value": "${trackedEmoteId.emoteId?c}"
},
{
"name": "<@safe_include "showExternalTrackedEmote_response_embed_link_field_title"/>",
"value": "[<@safe_include "showExternalTrackedEmote_response_embed_emote_link_field_alt_text"/>](${externalUrl})"
}
],
"imageUrl": "${externalUrl}"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "showTrackedEmotes_animated_tracked_emotes_title"/>"
},
<#include "statistic_color">,
"description": "<#list animatedEmotes as emote><#if emote.emote?has_content>${emote.emote.asMention}<#if !emote.trackedEmote.trackingEnabled>(<#include "showTrackedEmotes_emote_tracking_disabled">)</#if><#sep>, </#if></#list>"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "showTrackedEmotes_deleted_animated_tracked_emotes_title"/>"
},
<#include "statistic_color">,
"description": "<#list deletedAnimatedEmotes as emote>`${emote.emoteName}:${emote.trackedEmoteId.emoteId?c}`<#if !emote.trackingEnabled>(<#include "showTrackedEmotes_emote_tracking_disabled">)</#if><#sep>, </#list>"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "showTrackedEmotes_deleted_static_tracked_emotes_title"/>"
},
<#include "statistic_color">,
"description": "<#list deletedStaticEmotes as emote>`${emote.emoteName}:${emote.trackedEmoteId.emoteId?c}`<#if !emote.trackingEnabled>(<#include "showTrackedEmotes_emote_tracking_disabled">)</#if><#sep>, </#list>"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "showTrackedEmotes_external_animated_tracked_emotes_title"/>"
},
<#include "statistic_color">,
"description": "<#list externalAnimatedEmotes as emote>`${emote.emoteName}:${emote.trackedEmoteId.emoteId?c}`<#if !emote.trackingEnabled>(<#include "showTrackedEmotes_emote_tracking_disabled">)</#if><#sep>, </#list>"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "showTrackedEmotes_external_static_tracked_emotes_title"/>"
},
<#include "statistic_color">,
"description": "<#list externalStaticEmotes as emote>`${emote.emoteName}:${emote.trackedEmoteId.emoteId?c}`<#if !emote.trackingEnabled>(<#include "showTrackedEmotes_emote_tracking_disabled">)</#if><#sep>, </#list>"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "showTrackedEmotes_response_embed_title"/>"
},
<#include "warning_color">,
"description": "<@safe_include "showTrackedEmotes_no_emotes_available"/>"
}
@@ -0,0 +1,7 @@
{
"title": {
"title": "<@safe_include "showTrackedEmotes_static_tracked_emotes_title"/>"
},
<#include "statistic_color">,
"description": "<#list staticEmotes as emote><#if emote.emote?has_content>${emote.emote.asMention}<#if !emote.trackedEmote.trackingEnabled>(<#include "showTrackedEmotes_emote_tracking_disabled">)</#if><#sep> </#if></#list>"
}
@@ -0,0 +1,9 @@
{
"title": {
"title": "<@safe_include "syncTrackedEmotes_result_response_embed_title"/>"
},
<#include "statistic_color">,
<#assign emotesAdded=emotesAdded>
<#assign emotesDeleted=emotesMarkedDeleted>
"description": "<@safe_include "syncTrackedEmotes_result_response_description"/>"
}
@@ -0,0 +1,5 @@
"color" : {
"r": 196,
"g": 107,
"b": 215
}
@@ -0,0 +1 @@
"description": "<@safe_include "emote_stats_download_file_size_too_big"/>"
@@ -0,0 +1 @@
<#assign fileSize=model.fileSize><#assign maxFileSize=model.fileSizeLimit><#include "emote_stats_download_file_size_too_big_text">
@@ -1 +1 @@
Part of default configuration
default
@@ -1 +1 @@
The current feature mode of feature ${featureName} is incorrect to execute command ${commandName}. One of the following is required: ${featureModes}
The current feature mode of feature ${featureName} is incorrect. One of the following is required: ${featureModes}
+1
View File
@@ -22,6 +22,7 @@
<module>modmail</module>
<module>utility</module>
<module>assignable-roles</module>
<module>statistic</module>
</modules>
</project>
+39
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.abstracto-templates.translations</groupId>
<artifactId>translations</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<artifactId>statistic</artifactId>
<version>1.0-SNAPSHOT</version>
<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>statistic-translations-${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 @@
Deletes a tracked emote from the database and removes all emote usages.
@@ -0,0 +1 @@
The tracked emote to delete, this can either be the emote directly or the ID.
@@ -0,0 +1 @@
Shows the emote statistics for emotes which were deleted from this server
@@ -0,0 +1 @@
This command will the name and the ID of emotes which were previously tracked on this server, but have since been been deleted.
@@ -0,0 +1 @@
The time period to retrieve the deleted emote statistics for
@@ -0,0 +1 @@
This command disables the tracking of a tracked emote. Past usages will still show up in the stats.
@@ -0,0 +1 @@
The tracked emote to disable tracking for, this can either be the emote directly or the ID.
@@ -0,0 +1 @@
Emote stats for guild: ${guildName}<#if statsSince?has_content> since ${sinceDate}</#if>
@@ -0,0 +1,4 @@
Provides the used emotes of this server in a .csv file split per day.
The information contains the emote ID, server ID, the day of the usage and the times it was used.
It is possible to restrict the downloaded content for a time period to only download the last five days for example.
If the file is larger than the max file size allowed on the server, this command command shows an error and if no used emotes are found no file is provided.
@@ -0,0 +1 @@
The period of time to download the used emotes for
@@ -0,0 +1 @@
Shows the emote statistics for emotes which are still available in this server
@@ -0,0 +1 @@
This command will show the emotes of this server which are being tracked and the amount of times they have been used.
@@ -0,0 +1 @@
The time period to retrieve the emote statistics for
@@ -0,0 +1 @@
Shows the emote statistics for external emotes
@@ -0,0 +1 @@
This command will show the name and ID of emotes outside of this server which are being tracked and the amount of times they have been used.
@@ -0,0 +1 @@
The time period to retrieve the external emote statistics for
@@ -0,0 +1 @@
Removes the usages for one specific emote
@@ -0,0 +1 @@
Removes the usages from one specific emote from the database. The option period can be used to determine for how much time the usages should be deleted.
@@ -0,0 +1 @@
The time period for which tracked emote usages should be deleted. Infinite if not provided.
@@ -0,0 +1 @@
The tracked emote for which usages should be deleted
@@ -0,0 +1 @@
This command completely resets the stored tracked emotes and usages thereof. It will delete all tracked emotes.
@@ -0,0 +1 @@
Shows the link and image of an external emote. Does not work for deleted emotes or emotes from this server.
@@ -0,0 +1 @@
Shows the emotes which are currently being tracked, which might include external emotes and already deleted emotes.
@@ -0,0 +1 @@
`true`/`false`! to show whether or not you want you want to see tracked emotes for which tracking is disabled. Default: false
@@ -0,0 +1 @@
Synchronizes the state of the server with the database
@@ -0,0 +1,3 @@
Checks the currently available emotes of the server and synchronizes the state with the database.
This will not actually delete emotes or usages thereof, but only mark them as deleted, in case the emote was not found in the server anymore.
In case it finds new emotes, it will create them and automatically track them (depending on the feature mode).
@@ -0,0 +1,2 @@
${emotesAdded} have been added.
${emotesDeleted} have been marked as deleted.
@@ -0,0 +1 @@
Command to start tracking one particular emote
@@ -0,0 +1,2 @@
This command can be used to track one emote, if it is not yet tracked. If the command has been tracked before and is still part of the tracked emotes. This will just enable tracking again.
Beware: if its an external emote, the `externalEmotes` needs to be enabled.
@@ -0,0 +1 @@
The emote which should be tracked. This needs to be an actual emote used, but can be an ID if you are 're-tracking' a previously existing emote.
@@ -0,0 +1 @@
File was too large to upload. (${fileSize?c} B > ${maxFileSize?c} B)