Add site setting to allow adding “content” to Discord messages

This can include ‘mentions’ such as `@everyone`
This commit is contained in:
David Taylor 2017-09-01 21:03:31 +01:00
parent 9d99f5659a
commit 1fa228b68c
3 changed files with 4 additions and 0 deletions

View File

@ -30,6 +30,7 @@ en:
########## DISCORD SETTINGS ###########
#######################################
chat_integration_discord_enabled: "Enable the Discord chat-integration provider"
chat_integration_discord_message_content: "The message to include above the summary when sending a notification to Discord"
chat_integration_discord_excerpt_length: "Discord post excerpt length"
#######################################

View File

@ -46,6 +46,8 @@ plugins:
#######################################
chat_integration_discord_enabled:
default: false
chat_integration_discord_message_content:
default: ""
chat_integration_discord_excerpt_length:
default: 400

View File

@ -36,6 +36,7 @@ module DiscourseChat
end
message = {
content: SiteSetting.chat_integration_discord_message_content,
embeds: [{
title: post.topic.title,
description: post.excerpt(SiteSetting.chat_integration_discord_excerpt_length, text_entities: true, strip_links: true, remap_emoji: true),