refactored command responses to use a central place for configuration in an extra module

fixed makeAffected role parameter
made command check name case insensitive
added name to parameter for decayAllWarnings
removed simple log from message edited listener
This commit is contained in:
Sheldan
2020-04-30 22:29:49 +02:00
parent d5482fabd4
commit 59dc8c602a
312 changed files with 284 additions and 154 deletions

View File

@@ -1 +0,0 @@
Accepts the given suggestion. Will post the suggestion again, with the given reason for acceptance, with the old text strike through and 'Accepted by' as a notice.

View File

@@ -1 +0,0 @@
Rejects the given suggestion. Will post the suggestion again, with the given reason for rejection, with the old text strike through and 'Rejected by' as a notice.

View File

@@ -1,9 +0,0 @@
Reminds you in the given duration of the given text.
The reminder will also include a link to the original message.
The syntax for duration is the following:
s - seconds
m - minutes
h - hours
d - days
They must be positive and do no spaces between for example `1h23m` is one hour and twenty three minutes.

View File

@@ -8,19 +8,19 @@
"g": 0,
"b": 255
},
"description": "You wanted to be reminded.",
"description": "<#include "remind_reminder_description">",
"fields": [
{
"name": "Duration",
"name": "<#include "remind_reminder_duration_field_title">",
"value": "${fmtDuration(duration)}"
},
{
"name": "Note",
"name": "<#include "remind_reminder_note_field_title">",
"value": "${reminder.text}"
},
{
"name": "Link",
"value": "[Jump!](${messageUrl})"
"name": "<#include "remind_reminder_link_field_title">",
"value": "[<#include "remind_reminder_link_content_display_text">](${messageUrl})"
}
],
"additionalMessage": "${member.asMention}"

View File

@@ -1,4 +1,6 @@
{
<#assign id>${reminder.id}</#assign>
<#assign messageUrl>${message.jumpUrl}</#assign>
"author": {
"name": "${member.effectiveName}",
"avatar": "${member.user.effectiveAvatarUrl}"
@@ -8,6 +10,6 @@
"g": 0,
"b": 255
},
"description": "Scheduled reminder ${reminder.id} to remind you of [this](${message.jumpUrl})",
"description": "<#include "remind_reminding_description_text">",
"additionalMessage": "${member.asMention}"
}

View File

@@ -9,13 +9,14 @@
"b": 255
},
"title": {
"title": "Currently active reminders"
"title": "<#include "reminders_reminders_embed_title">"
},
"fields": [
<#list reminders as reminder>
{
"name": "Reminder ${reminder.id}",
"value": "Due on ${reminder.targetDate} with text ${reminder.text}"
<#assign id>${reminder.id}</#assign>
"name": "<#include "reminders_reminder_field_title">",
"value": "<#include "reminders_due_on">"
}
<#sep>,
</#list>

View File

@@ -1 +1 @@
**Name**: ${emote.name} **Link**: ${emote.imageUrl}
<#assign name> ${emote.name} </#assign> <#assign url> ${emote.imageUrl} </#assign>**<#include "showEmote_name">**: ${emote.name} **<#include "showEmote_link">**: ${emote.imageUrl}

View File

@@ -1,49 +1,51 @@
{
"title": {
"title": "Server starboard stats"
"title": "<#include "starStats_response_title">"
},
"color" : {
"r": 200,
"g": 0,
"b": 255
},
"description": "${starredMessages} starred messages with ${totalStars} stars in total",
"description": "<#include "startStats_description">",
"fields": [
{
"name": "Top starred posts",
"name": "<#include "starStats_top_starred_field_title">",
"value": "
<#list topPosts as post>
${badgeEmotes[post?index]} - ${post.starCount} :star: [Jump!](${post.messageUrl})
<#assign badge>${badgeEmotes[post?index]}</#assign><#assign count>${post.starCount}</assign><#assign link>${post.messageUrl}</#assign> <#include "starStats_starred_entry">
<#else>
No starred messages.
<#include "starStats_no_starred_messages">
</#list>
"
},
{
"name": "Top starrer",
"name": "<#include "starStats_top_starrer_field_title">",
"value": "
<#list starGiver as starrer>
<#assign badge>${badgeEmotes[starrer?index]}</#assign><#assign count>${starrer.starCount}</assign>
<#if starrer.member?has_content>
${badgeEmotes[starrer?index]} - ${starrer.starCount} :star: ${starrer.member.asMention}
<#assign user>${starrer.member.asMention}</#assign> <#include "starStats_starrer_entry">
<#else>
${badgeEmotes[starrer?index]} - ${starrer.starCount} :star: ${starrer.user.id?c} (Left the guild)
<#assign user>${starrer.user.id?c}</#assign> <#include "starStats_starrer_entry_left_guild_en_US.ftl">
</#if>
<#else>
No starred messages.
<#include "starStats_no_starred_messages">
</#list>
"
},
{
"name": "Top star receiver",
"name": "<#include "starStats_top_receiver_field_title">",
"value": "
<#list starReceiver as starred>
<#assign badge>${badgeEmotes[starred?index]}</#assign><#assign count>${starred.starCount}</assign>
<#if starred.member?has_content>
${badgeEmotes[starred?index]} - ${starred.starCount} :star: ${starred.member.asMention}
<#assign user>${starred.member.asMention}</#assign> <#include "starStats_receiver_entry">
<#else>
${badgeEmotes[starred?index]} - ${starred.starCount} :star: ${starred.user.id?c} (Left the guild)
<#assign user>${starred.user.id?c}</#assign> <#include "starStats_receiver_entry_left_guild">
</#if>
<#else>
No starred messages.
<#include "starStats_no_starred_messages">
</#list>
"
}

View File

@@ -1 +0,0 @@
Suggests the given text in the `suggestions` post target to be voted on.

View File

@@ -8,22 +8,24 @@
"g": 0,
"b": 255
},
<#assign user>${member.effectiveName}</#assign>
<#assign id>${suggestion.id}</#assign>
<#if suggestion.state = "ACCEPTED">
"description": "~~${text}~~ \n✅ ${reason} - Accepted by ${member.effectiveName}",
"description": "~~${text}~~ \n✅ ${reason} - <#include "suggest_accepted_by">",
<#elseif suggestion.state = "REJECTED">
"description": "~~${text}~~ \n❌ ${reason} - Rejected by ${member.effectiveName}",
"description": "~~${text}~~ \n❌ ${reason} - <#include "suggest_rejected_by">",
<#else>
"description": "${text}",
</#if>
<#if suggestion.state = "ACCEPTED" || suggestion.state = "REJECTED">
"fields": [
{
"name": "Link",
"value": "[Jump](${originalMessageUrl})"
"name": "<#include "suggest_link_field_title">",
"value": "[<#include "suggest_link_display_value">](${originalMessageUrl})"
}
],
</#if>
"footer": {
"text": "Suggestion #${suggestion.id}"
"text": "<#include "suggest_suggestion_id_footer">"
}
}

View File

@@ -1,2 +0,0 @@
Suggests the given text in the `suggestions` post target to be voted on. Such a suggestion will have a globally unique id
and a suggestion can be accepted with `accept` or denied with `reject`.

View File

@@ -11,9 +11,9 @@
<#if embeddedMessage.content?has_content || embeddedMessage.embeds?size gt 0>
"description": "${embeddedMessage.content}
<#list embeddedMessage.embeds>
Embeds:
<#include "message_embed_embed_embeds_name">:
<#items as embed>
Description: <#if embed.description?has_content >${embed.description}</#if> <#if embed.imageUrl?has_content> ImageUrl: ${embed.imageUrl} </#if>
<#include "message_embed_embed_description">: <#if embed.description?has_content >${embed.description}</#if> <#if embed.imageUrl?has_content> <#include "message_embed_embed_image_url">: ${embed.imageUrl} </#if>
</#items>
</#list>
",
@@ -23,8 +23,11 @@
</#if>
"fields": [
{
"name": "Quoted by",
"value": "${embeddingUser.asMention} from [${sourceChannel.name}](${embeddedMessage.messageUrl})"
"name": "<#include "message_embed_embed_quoted_by_field_title">",
<#assign user>${embeddingUser.asMention}</#assign>
<#assign channelName>${sourceChannel.name}</#assign>
<#assign messageLink>${embeddedMessage.messageUrl}</#assign>
"value": "<#include "message_embed_embed_quoted_by_field_value">"
}
],
"timeStamp": "${embeddedMessage.timeCreated}"

View File

@@ -15,24 +15,29 @@
<#if message.content?has_content || message.embeds?size gt 0>
"description": "${message.content}
<#list message.embeds>
Embeds:
<#include "starboard_post_embed_embeds_name">:
<#items as embed>
Description: ${embed.description} <#if embed.imageUrl?has_content> ImageUrl: ${embed.imageUrl} </#if>
<#include "starboard_post_embed_description">: ${embed.description} <#if embed.imageUrl?has_content> <#include "starboard_post_embed_image_url">: ${embed.imageUrl} </#if>
</#items>
</#list>
",
</#if>
<#assign emote>${starLevelEmote}</#assign>
<#assign count>${starCount}</#assign>
<#assign messageId>${message.messageId?c}</#assign>
<#if channel?has_content>
"additionalMessage": "${starLevelEmote} ${starCount} ${channel.asMention} ID: ${message.messageId?c}",
<#assign channel>${channel.asMention}</#assign>
"additionalMessage": "<#include "starboard_post_embed_additional_message">",
<#else>
"additionalMessage": "${starLevelEmote} ${starCount} ${aChannel.id?c} ID: ${message.messageId?c}",
<#assign channel>${aChannel.id?c}</#assign>
"additionalMessage": "<#include "starboard_post_embed_additional_message">",
</#if>
<#if message.attachmentUrls?size gt 0>
"imageUrl": "${message.attachmentUrls[0]}",
</#if>
"fields": [
{
"name": "Original",
"name": "<#include "starboard_post_embed_original_field_title">",
<#if channel?has_content>
"value": "[${channel.name}](${message.messageUrl})"
<#else>