mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-07-03 09:37:44 +00:00
Add initial transmitter implementation (discord)
This has been tested with one webhook in one channel. Sends, edits and deletions work fine
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user