mirror of
https://github.com/Sheldan/abstracto-templates.git
synced 2026-04-15 20:16:36 +00:00
[AB-30] adding giveaway feature
This commit is contained in:
37
abstracto-modules/giveaway/pom.xml
Normal file
37
abstracto-modules/giveaway/pom.xml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?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">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>dev.sheldan.abstracto-templates.templates</groupId>
|
||||||
|
<artifactId>abstracto-modules</artifactId>
|
||||||
|
<version>1.4.24-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>giveaway</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>giveaway-templates-${project.version}</finalName>
|
||||||
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
|
<descriptors>
|
||||||
|
<descriptor>src/main/assembly/assembly.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
15
abstracto-modules/giveaway/src/main/assembly/assembly.xml
Normal file
15
abstracto-modules/giveaway/src/main/assembly/assembly.xml
Normal 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>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"additionalMessage": "<@safe_include "cancelGiveaway_response_text"/>",
|
||||||
|
"messageConfig": {
|
||||||
|
"ephemeral": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"additionalMessage": "<@safe_include "createGiveaway_response_text"/>",
|
||||||
|
"messageConfig": {
|
||||||
|
"ephemeral": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"additionalMessage": "<@safe_include "reRollGiveaway_response_text"/>",
|
||||||
|
"messageConfig": {
|
||||||
|
"ephemeral": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<#include "giveaway_not_found_exception_message">
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<#include "format_instant">
|
||||||
|
{
|
||||||
|
"embeds": [
|
||||||
|
{
|
||||||
|
"title": {
|
||||||
|
<#assign title=title?json_string>
|
||||||
|
<#assign id=giveawayId?json_string>
|
||||||
|
"title": "<@safe_include "giveaway_post_embed_title"/>"
|
||||||
|
},
|
||||||
|
<#include "abstracto_color">,
|
||||||
|
<#if description?has_content><#assign description=description?json_string></#if>
|
||||||
|
<#assign endDate><@format_instant_relative instant=targetDate/></#assign>
|
||||||
|
<#assign host=creator.memberMention/>
|
||||||
|
<#if benefactor?has_content><#assign benefactor=benefactor.memberMention/></#if>
|
||||||
|
<#assign memberMentions><#list winners as winner>${winner.memberMention}<#sep>,<#else><@safe_include "giveaway_result_no_winner"/></#list></#assign>
|
||||||
|
<#assign cancelled=cancelled>
|
||||||
|
<#assign entries=joinedUserCount>
|
||||||
|
<#assign ended=ended>
|
||||||
|
<#assign winnerCount=winnerCount>
|
||||||
|
"description": "<@safe_include "giveaway_post_embed_description"/>"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
<#if !cancelled && !ended>,
|
||||||
|
"buttons": [
|
||||||
|
{
|
||||||
|
"label": "<@safe_include "giveaway_post_join_button_label"/>",
|
||||||
|
"id": "${joinComponentId}",
|
||||||
|
"buttonStyle": "secondary",
|
||||||
|
"metaConfig": {
|
||||||
|
"persistCallback": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
</#if>
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
<#assign winnerCount=winners?size>
|
||||||
|
<#assign memberMentions><#list winners as winner>${winner.memberMention}<#sep>,</#list></#assign>
|
||||||
|
<#assign prize=title>
|
||||||
|
"additionalMessage": "<#if winnerCount gt 0><@safe_include "giveaway_result_text"/><#else><@safe_include "giveaway_result_no_winner"/></#if>",
|
||||||
|
"referencedMessageId": "${messageId?c}"
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"additionalMessage": "<@safe_include "giveaway_already_joined_response_text"/>",
|
||||||
|
"messageConfig": {
|
||||||
|
"ephemeral": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"additionalMessage": "<@safe_include "giveaway_join_response_text"/>",
|
||||||
|
"messageConfig": {
|
||||||
|
"ephemeral": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
<module>anti-raid</module>
|
<module>anti-raid</module>
|
||||||
<module>custom-command</module>
|
<module>custom-command</module>
|
||||||
<module>twitch</module>
|
<module>twitch</module>
|
||||||
|
<module>giveaway</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
38
translations/giveaway/pom.xml
Normal file
38
translations/giveaway/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">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||||
|
<artifactId>translations</artifactId>
|
||||||
|
<version>1.4.24-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>giveaway</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>giveaway-translations-${project.version}</finalName>
|
||||||
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
|
<descriptors>
|
||||||
|
<descriptor>src/main/assembly/assembly.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
15
translations/giveaway/src/main/assembly/assembly.xml
Normal file
15
translations/giveaway/src/main/assembly/assembly.xml
Normal 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>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
The giveaway has been cancelled.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Cancels a giveaway
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
This command is used to cancel a giveaway.
|
||||||
|
The giveaway will be disabled and the text will be struck through.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
The ID of the giveaway to cancel
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Giveaway has been created.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Creates a giveaway
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
This command can be used to create a giveaway.
|
||||||
|
A giveaway needs a title and a duration.
|
||||||
|
Additional optional parameters are: description, benefactor (the user who sponsored the giveaway), a channel different to the post target and an amount of winners.
|
||||||
|
Per default there is 1 winner and the post target 'giveaways' is used.
|
||||||
|
A giveaway will then automatically evaluate the winners, but it can be cancelled.
|
||||||
|
The giveaway can then also be rerolled.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
The member who sponsored this giveaway
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
The channel the giveaway should be posted in
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Description shown in the giveaway
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
The duration of the giveaway
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
What the giveaway is about
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
The amount of winners in this giveaway
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Re-rolls a giveaway
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
This command can be used to re-roll a giveaway. This means that the winners are drawn new.
|
||||||
|
The previous winner can win again.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
The ID of the giveaway to re-roll
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Rerolled the giveaway.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Giveaway
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
The channel to create giveaways in. Currently: ${currentTarget}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Giveaway not found.
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<#if cancelled>~~</#if>
|
||||||
|
<#if description?has_content>${description}</#if>
|
||||||
|
Giveaway end: ${endDate}
|
||||||
|
Hosted by: ${host}
|
||||||
|
<#if benefactor?has_content>Provided by: ${benefactor}</#if>
|
||||||
|
Entries: ${entries}
|
||||||
|
Winners: <#if ended>${memberMentions}<#else>${winnerCount}</#if>
|
||||||
|
<#if cancelled>~~</#if>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Giveaway #${id} - ${title}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Join
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
No winner.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Congratulations ${memberMentions}! You won **${prize}**!! :tada::tada:
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Already joined the giveaway.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
You joined the giveaway.
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
<module>anti-raid</module>
|
<module>anti-raid</module>
|
||||||
<module>custom-command</module>
|
<module>custom-command</module>
|
||||||
<module>twitch</module>
|
<module>twitch</module>
|
||||||
|
<module>giveaway</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
Reference in New Issue
Block a user