diff options
author | Qais Patankar <qaisjp@gmail.com> | 2020-12-31 16:15:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-31 16:15:42 +0000 |
commit | 6cadf1226004f2f2d91403c8bc81ca975a77ca52 (patch) | |
tree | c7ce9ded0a6031656db26ca8acd56180d8511524 | |
parent | 19d47784bde7f5d8cfc06f868350ed6ac69c8a21 (diff) | |
download | matterbridge-msglm-6cadf1226004f2f2d91403c8bc81ca975a77ca52.tar.gz matterbridge-msglm-6cadf1226004f2f2d91403c8bc81ca975a77ca52.tar.bz2 matterbridge-msglm-6cadf1226004f2f2d91403c8bc81ca975a77ca52.zip |
Add a prefix handler for unthreaded messages (discord) (#1346)
-rw-r--r-- | bridge/discord/discord.go | 6 |
1 files changed, 6 insertions, 0 deletions
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 == "" { |