From c6fd65d1d7f5085890c0a00d37be8d6abb458921 Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 23 Nov 2018 20:52:31 +0100 Subject: Limit discord username via webhook to 32 chars --- bridge/discord/discord.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bridge/discord') diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index d3fc8eb4..00dd32b9 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -164,6 +164,10 @@ func (b *Bdiscord) Send(msg config.Message) (string, error) { msg.Text = helper.ClipMessage(msg.Text, MessageLength) msg.Text = b.replaceUserMentions(msg.Text) + // discord username must be [0..32] max + if len(msg.Username) > 32 { + msg.Username = msg.Username[0:32] + } err := b.c.WebhookExecute( wID, wToken, -- cgit v1.2.3