diff options
author | Qais Patankar <qaisjp@gmail.com> | 2020-11-30 05:47:02 +0000 |
---|---|---|
committer | Wim <wim@42.be> | 2020-12-13 23:19:48 +0100 |
commit | 52e2f926f423295dbf95463218bed6abd94d574a (patch) | |
tree | 18b7f76ab647c73a631c257ef806513dd04e90ed /bridge/discord/helpers.go | |
parent | 611fb279bc3680ef9e241e913589dc9056c2f5bd (diff) | |
download | matterbridge-msglm-52e2f926f423295dbf95463218bed6abd94d574a.tar.gz matterbridge-msglm-52e2f926f423295dbf95463218bed6abd94d574a.tar.bz2 matterbridge-msglm-52e2f926f423295dbf95463218bed6abd94d574a.zip |
Add initial transmitter implementation (discord)
This has been tested with one webhook in one channel.
Sends, edits and deletions work fine
Diffstat (limited to 'bridge/discord/helpers.go')
-rw-r--r-- | bridge/discord/helpers.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bridge/discord/helpers.go b/bridge/discord/helpers.go index 73536cf4..9545a3ae 100644 --- a/bridge/discord/helpers.go +++ b/bridge/discord/helpers.go @@ -196,7 +196,7 @@ func (b *Bdiscord) replaceAction(text string) (string, bool) { } // 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, bool) { const ( expectedWebhookSplitCount = 7 webhookIdxID = 5 @@ -204,9 +204,9 @@ func (b *Bdiscord) splitURL(url string) (string, string) { ) webhookURLSplit := strings.Split(url, "/") if len(webhookURLSplit) != expectedWebhookSplitCount { - b.Log.Fatalf("%s is no correct discord WebhookURL", url) + return "", "", false } - return webhookURLSplit[webhookIdxID], webhookURLSplit[webhookIdxToken] + return webhookURLSplit[webhookIdxID], webhookURLSplit[webhookIdxToken], true } func enumerateUsernames(s string) []string { |