diff options
author | Wim <wim@42.be> | 2018-11-23 20:52:31 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2018-11-23 20:52:31 +0100 |
commit | c6fd65d1d7f5085890c0a00d37be8d6abb458921 (patch) | |
tree | bd61394cb8ccd20463d500386ee6c070aa55ad31 /bridge/discord | |
parent | 079590653317c0e48b50b377e0e2bce1134f78a6 (diff) | |
download | matterbridge-msglm-c6fd65d1d7f5085890c0a00d37be8d6abb458921.tar.gz matterbridge-msglm-c6fd65d1d7f5085890c0a00d37be8d6abb458921.tar.bz2 matterbridge-msglm-c6fd65d1d7f5085890c0a00d37be8d6abb458921.zip |
Limit discord username via webhook to 32 chars
Diffstat (limited to 'bridge/discord')
-rw-r--r-- | bridge/discord/discord.go | 4 |
1 files changed, 4 insertions, 0 deletions
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, |