diff options
author | Wim <wim@42.be> | 2018-02-07 14:57:38 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2018-02-07 14:57:38 +0100 |
commit | 83c28cb857e47e8e2958745eeac7f97448909968 (patch) | |
tree | 2484b148ea7c439159971fb4b2c2e50940a2d9bc /bridge/discord | |
parent | df5bce27b04e4942ca71a1d1d75c4cb73cdb39de (diff) | |
download | matterbridge-msglm-83c28cb857e47e8e2958745eeac7f97448909968.tar.gz matterbridge-msglm-83c28cb857e47e8e2958745eeac7f97448909968.tar.bz2 matterbridge-msglm-83c28cb857e47e8e2958745eeac7f97448909968.zip |
Check for a valid WebhookURL (discord). Closes #367
Diffstat (limited to 'bridge/discord')
-rw-r--r-- | bridge/discord/discord.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index d57f9122..1f7e50c8 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -369,6 +369,9 @@ func (b *bdiscord) stripCustomoji(text string) string { // splitURL splits a webhookURL and returns the id and token func (b *bdiscord) splitURL(url string) (string, string) { webhookURLSplit := strings.Split(url, "/") + if len(webhookURLSplit) != 7 { + log.Fatalf("%s is no correct discord WebhookURL", url) + } return webhookURLSplit[len(webhookURLSplit)-2], webhookURLSplit[len(webhookURLSplit)-1] } |