[AB-90] adding poll functionality

This commit is contained in:
Sheldan
2023-06-04 21:10:55 +02:00
parent 9373b07c8a
commit 7e99db3733
67 changed files with 264 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
{
"additionalMessage": "<@safe_include "cancelPoll_response_text"/>",
"messageConfig": {
"ephemeral": true
}
}

View File

@@ -0,0 +1,6 @@
{
"additionalMessage": "<@safe_include "closePoll_response_text"/>",
"messageConfig": {
"ephemeral": true
}
}

View File

@@ -0,0 +1,16 @@
{
"embeds": [
{
"description": "<@safe_include "poll_server_close_message_description"/>"
<#if text?has_content>,
"fields": [
{
"name": "<@safe_include "poll_server_close_message_embed_text_field_title"/>",
"value": "${text?json_string}"
}
]
</#if>
}
],
"referencedMessageId": "${pollMessageId?c}"
}

View File

@@ -0,0 +1,24 @@
{
"id": "${modalId}",
"title": "<@safe_include "poll_server_add_option_modal_title"/>",
"textInputs": [
{
"placeHolder": "<@safe_include "poll_server_add_option_modal_label_placeholder"/>",
"id": "${labelInputComponentId}",
"position": 1,
"label": "<@safe_include "poll_server_add_option_modal_label_label"/>",
"style": "paragraph",
"maxLength": 100,
"required": true
},
{
"placeHolder": "<@safe_include "poll_server_add_option_modal_description_placeholder"/>",
"id": "${descriptionInputComponentId}",
"position": 2,
"label": "<@safe_include "poll_server_add_option_modal_description_label"/>",
"style": "paragraph",
"maxLength": 100,
"required": false
}
]
}

View File

@@ -0,0 +1,6 @@
{
"additionalMessage": "<@safe_include "poll_add_option_notification_message"/>",
"messageConfig" : {
"ephemeral": true
}
}

View File

@@ -0,0 +1,6 @@
{
"additionalMessage": "<@safe_include "poll_decision_notification_message"/>",
"messageConfig" : {
"ephemeral": true
}
}

View File

@@ -0,0 +1,12 @@
{
"embeds": [
{
"title": {
"title": "<@safe_include "poll_server_evaluation_title"/>"
},
<#include "abstracto_color">,
"description": "<#list options as option><#assign option=option><@safe_include "poll_message_option_display_always"/><#sep>\n</#list>"
}
],
"referencedMessageId": "${pollMessageId?c}"
}

View File

@@ -0,0 +1,47 @@
<#include "format_instant">
{
"embeds": [
{
"title": {
"title": "<@safe_include "poll_server_message_title"/>"
},
<#assign formattedEndDate><@format_instant_relative instant=endDate/></#assign>
"description": "<@safe_include "poll_server_description_info"/><#list options as option><#assign option=option><@safe_include "poll_message_option_display"/><#sep>\n</#list>"
}
],
"selectionMenus": [
{
"position": 1,
"id": "${selectionMenuId}",
"type": "STRING",
"minValues": 1,
<#if allowMultiple>
"maxValues": ${options?size},
<#else>
"maxValues": 1,
</#if>
"menuEntries": [
<#list options as option>
{
"value": "${option.value}",
"label": "${option.label}",
"description": "${option.description}"
}
<#sep>,</#list>
]
}
]
<#if allowAdditions && options?size lt 20>,
"buttons": [
{
"label": "add option",
"position": 2,
"id": "${addOptionButtonId}",
"buttonStyle": "secondary",
"metaConfig": {
"persistCallback": false
}
}
]
</#if>
}

View File

@@ -0,0 +1,21 @@
<#include "format_instant">
{
"embeds": [
{
<#include "abstracto_color"/>,
<#assign pollId=pollId>
<#assign description=description>
"description": "<@safe_include "poll_reminder_job_notification_message_description"/><#list topOptions as option><#assign option=option><@safe_include "poll_message_option_display_always"/><#sep>\n</#list>"
}
],
"buttons": [
{
"label": "<@safe_include "poll_server_reminder_job_button_jump"/>",
"url": "${messageLink?json_string}",
"buttonStyle": "link",
"metaConfig": {
"persistCallback": false
}
}
]
}

View File

@@ -0,0 +1,3 @@
{
"additionalMessage": "<@safe_include "poll_server_response_text"/>"
}

View File

@@ -0,0 +1,6 @@
{
"additionalMessage": "<@safe_include "poll_quick_decision_notification_message"/>",
"messageConfig" : {
"ephemeral": true
}
}

View File

@@ -0,0 +1,12 @@
{
"embeds": [
{
"title": {
"title": "<@safe_include "poll_quick_evaluation_title"/>"
},
<#include "abstracto_color">,
"description": "<#list options as option><#assign option=option><@safe_include "poll_message_option_display_always"/><#sep>\n</#list>"
}
],
"referencedMessageId": "${pollMessageId?c}"
}

View File

@@ -0,0 +1,34 @@
<#include "format_instant">
{
"embeds": [
{
"title": {
"title": "<@safe_include "poll_quick_message_title"/>"
},
<#assign formattedEndDate><@format_instant_relative instant=endDate/></#assign>
"description": "<@safe_include "poll_quick_description_info"/><#list options as option><#assign option=option><@safe_include "poll_quick_message_option_display"/><#sep>\n</#list>"
}
],
"selectionMenus": [
{
"position": 1,
"id": "${selectionMenuId}",
"type": "STRING",
"minValues": 1,
<#if allowMultiple>
"maxValues": ${options?size},
<#else>
"maxValues": 1,
</#if>
"menuEntries": [
<#list options as option>
{
"value": "${option.value}",
"label": "${option.label}",
"description": "${option.description}"
}
<#sep>,</#list>
]
}
]
}

View File

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

View File

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

View File

@@ -0,0 +1,2 @@
Cancels and deletes a server poll.
Only possible if you are the creator of the poll and if the poll is not older than one hour

View File

@@ -0,0 +1 @@
The ID of the server poll to cancel

View File

@@ -0,0 +1,2 @@
Closes the server poll and posts an update message with the accompanied optional text.
The message will be shown in the polls post target.

View File

@@ -0,0 +1 @@
The ID of the server poll to close

View File

@@ -0,0 +1 @@
Text to show with the poll update message

View File

@@ -0,0 +1 @@
Create a server wide poll

View File

@@ -0,0 +1,4 @@
Create a server wide poll with possible arguments.
You can select to allow additional options, show the decisions within the poll message and whether multiple options are allowed to be selected.
You can enter at most 15 options and define a duration to show when the poll should end.
If the duration ends and the appropriate feature modes are enabled, the poll will be evaluated and a reminder will be send and the poll will be closed.

View File

@@ -0,0 +1 @@
Whether to allow adding new options

View File

@@ -0,0 +1 @@
Whether to allow selecting multiple options

View File

@@ -0,0 +1 @@
Options which should be shown. Label and description can be separated using ;

View File

@@ -0,0 +1 @@
The duration for how long it should be possible to add votes

View File

@@ -0,0 +1 @@
Whether to show the votes in the poll message

View File

@@ -0,0 +1 @@
Submitted! You have chosen the options: <#list chosenValues as chosenValue>${chosenValue}<#sep>, </#list>

View File

@@ -0,0 +1 @@
Option: `${option.label}` votes: ${option.votes} (${option.percentage}%)

View File

@@ -0,0 +1 @@
${option.label} <#if showDecisions>votes: ${option.votes} (${option.percentage}%)</#if>

View File

@@ -0,0 +1,2 @@
Poll ${pollId} ended.
Most voted option(s) were:

View File

@@ -0,0 +1,2 @@
> Voting end: ${formattedEndDate}

View File

@@ -0,0 +1 @@
Poll `${description}` ended.

View File

@@ -0,0 +1 @@
Poll ${pollId} - `${description}`

View File

@@ -0,0 +1,4 @@
Create a poll in the current channel.
You can select to show the decisions within the poll message and whether multiple options are allowed to be selected.
You can enter at most 15 options and define a duration to show when the poll should end.
If the duration ends, the poll will be closed and the update will the send in the current channel.

View File

@@ -0,0 +1 @@
Whether to allow selecting multiple options

View File

@@ -0,0 +1 @@
Options which should be shown. Label and description can be separated using ;

View File

@@ -0,0 +1 @@
The duration for how long it should be possible to add votes

View File

@@ -0,0 +1 @@
Whether to show the votes in the poll message

View File

@@ -0,0 +1 @@
Submitted! You have chosen the options: <#list chosenValues as chosenValue>${chosenValue}<#sep>, </#list>

View File

@@ -0,0 +1,2 @@
> Voting end: ${formattedEndDate}

View File

@@ -0,0 +1 @@
Poll `${description}` ended.

View File

@@ -0,0 +1 @@
Option: `${option.label}` <#if showDecisions>votes: ${option.votes} (${option.percentage}%)</#if>

View File

@@ -0,0 +1 @@
Poll ${pollId} - `${description}`

View File

@@ -0,0 +1 @@
Duration for server polls in seconds. Default: ${defaultValue}

View File

@@ -0,0 +1 @@
The channel where server polls reminders should be posted to. Currently: ${currentTarget}

View File

@@ -0,0 +1 @@
The channel where server polls should be posted to. Currently: ${currentTarget}

View File

@@ -0,0 +1 @@
Duplicated poll option detected.