summaryrefslogtreecommitdiffstats
path: root/bridge/discord/helpers.go
diff options
context:
space:
mode:
authorMOZGIII <mike-n@narod.ru>2019-08-29 01:13:10 +0300
committerWim <wim@42.be>2019-08-29 00:13:10 +0200
commitcec086994e1b00ee1230c6657f5fedaa2ce90372 (patch)
tree5c628c3a0e7297d7ec3c2711ccd182b90604030e /bridge/discord/helpers.go
parent942d8f1cedfb7325c0720f8967751bb1b77f5b82 (diff)
downloadmatterbridge-msglm-cec086994e1b00ee1230c6657f5fedaa2ce90372.tar.gz
matterbridge-msglm-cec086994e1b00ee1230c6657f5fedaa2ce90372.tar.bz2
matterbridge-msglm-cec086994e1b00ee1230c6657f5fedaa2ce90372.zip
Add support for sending files via webhook (discord) (#872)
Diffstat (limited to 'bridge/discord/helpers.go')
-rw-r--r--bridge/discord/helpers.go24
1 files changed, 0 insertions, 24 deletions
diff --git a/bridge/discord/helpers.go b/bridge/discord/helpers.go
index 58676842..1447c530 100644
--- a/bridge/discord/helpers.go
+++ b/bridge/discord/helpers.go
@@ -1,7 +1,6 @@
package bdiscord
import (
- "encoding/json"
"errors"
"regexp"
"strings"
@@ -236,26 +235,3 @@ func enumerateUsernames(s string) []string {
}
return usernames
}
-
-// webhookExecute executes a webhook.
-// webhookID: The ID of a webhook.
-// token : The auth token for the webhook
-// wait : Waits for server confirmation of message send and ensures that the return struct is populated (it is nil otherwise)
-func (b *Bdiscord) webhookExecute(webhookID, token string, wait bool, data *discordgo.WebhookParams) (st *discordgo.Message, err error) {
- uri := discordgo.EndpointWebhookToken(webhookID, token)
-
- if wait {
- uri += "?wait=true"
- }
- response, err := b.c.RequestWithBucketID("POST", uri, data, discordgo.EndpointWebhookToken("", ""))
- if !wait || err != nil {
- return nil, err
- }
-
- err = json.Unmarshal(response, &st)
- if err != nil {
- return nil, discordgo.ErrJSONUnmarshal
- }
-
- return st, nil
-}