From 6cadf1226004f2f2d91403c8bc81ca975a77ca52 Mon Sep 17 00:00:00 2001 From: Qais Patankar Date: Thu, 31 Dec 2020 16:15:42 +0000 Subject: [PATCH] Add a prefix handler for unthreaded messages (discord) (#1346) --- bridge/discord/discord.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index c8b810c6..daeaa403 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -242,6 +242,12 @@ func (b *Bdiscord) Send(msg config.Message) (string, error) { msg.Text = "_" + msg.Text + "_" } + // Handle prefix hint for unthreaded messages. + if msg.ParentID == "msg-parent-not-found" { + msg.ParentID = "" + msg.Text = fmt.Sprintf("[thread]: %s", msg.Text) + } + // Use webhook to send the message useWebhooks := b.shouldMessageUseWebhooks(&msg) if useWebhooks && msg.Event != config.EventMsgDelete && msg.ParentID == "" {