5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-26 20:21:35 +00:00

Check for a valid WebhookURL (discord). Closes #367

This commit is contained in:
Wim 2018-02-07 14:57:38 +01:00
parent df5bce27b0
commit 83c28cb857

View File

@ -369,6 +369,9 @@ func (b *bdiscord) stripCustomoji(text string) string {
// splitURL splits a webhookURL and returns the id and token // splitURL splits a webhookURL and returns the id and token
func (b *bdiscord) splitURL(url string) (string, string) { func (b *bdiscord) splitURL(url string) (string, string) {
webhookURLSplit := strings.Split(url, "/") 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] return webhookURLSplit[len(webhookURLSplit)-2], webhookURLSplit[len(webhookURLSplit)-1]
} }